Initial feedback for std.experimental.image

ponce via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 21 09:01:03 PDT 2015


On Friday, 10 July 2015 at 05:27:21 UTC, rikki cattermole wrote:
> What we need is a unsigned integer type **of word size**

Sorry for being picky there.

At least in x86, machine word size aka 64-bit integers in 64-bit 
are generally not faster.

- first, all operations are operating on 32-bit integers by 
default, unless those with a REX prefix. The important part is 
that _those instructions with a REX prefix take more bytes_. This 
has 2 effects, one on the size of the code itself (expect more 
icache usage), and one on the instruction decoding queue 
(processor can't process out of order too much long instruction, 
I believe the limit is a 16-byte lookahead or something).
- secondly to avoid false dependencies, the upper 32-bit of 
registers are cleared.

   mov ECX, 0; // will clear the whole RCX register.


So while the code size may not be a big deal in the general 
scheme, it has literally no downsides to use as much 32-bit 
operations as possible even in 64-bit modes on x86. I don't know 
with ARM or others.






More information about the Digitalmars-d mailing list