comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: avoiding builtin memset
Date: Thu, 27 Apr 2017 08:09:12 +0100
Date: 2017-04-27T08:09:12+01:00	[thread overview]
Message-ID: <lyshku5ntz.fsf@pushface.org> (raw)
In-Reply-To: odrs9b$431$1@dont-email.me

"J-P. Rosen" <rosen@adalog.fr> writes:

> Le 27/04/2017 à 02:22, Jere a écrit :
>>> 	For Element of Memory loop
>>> 	    Element := Value;
>>> 	end loop;
>>
>> I'll be honest, I wasn't expecting it to avoid memset (didn't see why
>> it should), but it didn't recursively call it.  It did however, do a
>> very interesting loop unroll:
>> [...]
> What if you replace the loop with:
>    Memory := (others => Value);

That's when the generated code calls memset(3). Unless, I guess, you've
set System up to forbid composite assignments?

I changed my (Cortex) system.ads to

   Support_Aggregates        : constant Boolean := False;

and this code

      --  Initialize BSS in SRAM
      Bss := (others => 0);

results in

startup.adb:113:14: aggregate not supported by configuration

whereas system.ads:

   Support_Composite_Assign  : constant Boolean := False;

results in

startup.adb:113:11: composite assignment not supported by configuration

  reply	other threads:[~2017-04-27  7:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24 16:06 avoiding builtin memset Jere
2017-04-24 16:56 ` Shark8
2017-04-25  1:21   ` Anh Vo
2017-04-25  2:57     ` Luke A. Guest
2017-04-25 18:43       ` Shark8
2017-04-25 22:18         ` Luke A. Guest
2017-04-26  7:35           ` Simon Wright
2017-04-26 13:44             ` Lucretia
2017-04-26 15:22               ` Simon Wright
2017-04-27  0:22   ` Jere
2017-04-27  4:35     ` J-P. Rosen
2017-04-27  7:09       ` Simon Wright [this message]
2017-05-24 15:08 ` Frédéric PRACA
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox