seeding the pot for 2.0 features [small vectors]

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Tue Jan 30 18:10:10 PST 2007


Joel C. Salomon wrote:
> Mikola Lysenko wrote:
>>     Inline assmeber can not be inlined.  Period.  The compiler has to 
>> think of inline assembler as a sort of black box, which takes inputs 
>> one way and returns them another way.  It can not poke around in there 
>> and change your hand-tuned opcodes in order to pass arguments in 
>> arguments more efficiently.  Nor can it change the way you allocate 
>> registers so you don't accidentally trash the local frame.  It can't 
>> manipulate where you put the result, such that it can be used 
>> immediately by the next block of code.  Therefore any asm vector class 
>> will have a lot of wasteful function calls which quickly add up:
> 
> Sounds like what’s needed is in-line intermediate code rather than 
> in-line assembly — or, at least some way to tell the compiler “do this 
> operation on some block of eight SIMD registers; I don’t particularly 
> care which.”

GCC (and recent GDC) already has such a mechanism, they call it 
'extended assembler'.
The basic idea is that you can specify several substitutions for 
registers. You can have them pre-filled by GCC with specific 
expressions, tell GCC to put certain registers in variables afterwards, 
and specify what other registers (and optionally "memory") may be 
changed afterwards.
(That last part could perhaps be omitted if the compiler did some extra 
work to analyze the asm?)

The GCC version has pretty ugly syntax (IMHO), and I have no idea if 
they support SIMD registers with it, but I've always liked the idea itself.

But I've already mentioned much of this in a previous post in this thread.



More information about the Digitalmars-d mailing list