Initial feedback for std.experimental.image

Rikki Cattermole via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 21 09:27:20 PDT 2015


On 22/07/2015 4:01 a.m., ponce wrote:
> 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.

I would rather picky begins now, not later.
Having these sort of problems sorted out now, means when its time for 
review, you can't say I haven't argued for the design.

So in your view, I should ask the compiler devs of e.g. ldc/gdc of what 
would be the better way to go for production code in this instance?



More information about the Digitalmars-d mailing list