H1 2015 Priorities and Bare-Metal Programming

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 2 13:15:13 PST 2015


On 2/2/2015 9:15 AM, Johannes Pfau wrote:
> It's also necessary that the compiler
> knows after inlining that the address is a literal. Loading data from
> fixed literal addresses produces different, more efficient code than
> loading from an runtime address. As the function code will generally be
> written for runtime values the compiler must optimize after inlining
> to recognize the inlined code deals with literals.


   import core.bitop;
   uint test() {
     return volatileLoad(cast(uint *)0x1234);
   }
   ---
   dmd -c foo
   ---
   _D3foo4testFZkL:
         mov     EAX,01234h
         mov     EAX,[EAX]
         ret

Note that was an unoptimized build.


More information about the Digitalmars-d mailing list