Thread overview
Which XMM are safe to erase in asm{} blocks?
Jul 06, 2015
ponce
Jul 07, 2015
ponce
Jul 08, 2015
ketmar
Jul 08, 2015
ponce
July 06, 2015
What registers can I safely modify in asm {} blocks? Especially XMM registers.

I can't find the information on http://dlang.org/iasm.html

Note that this question isn't for function-call boundaries but asm{} boundaries since I do not use "naked;"
July 07, 2015
On Monday, 6 July 2015 at 08:54:48 UTC, ponce wrote:
> What registers can I safely modify in asm {} blocks? Especially XMM registers.
>
> I can't find the information on http://dlang.org/iasm.html
>
> Note that this question isn't for function-call boundaries but asm{} boundaries since I do not use "naked;"

Bump.

Is this secret knowledge?
July 08, 2015
On Tue, 07 Jul 2015 12:33:38 +0000, ponce wrote:

> Is this secret knowledge?

yes. ;-)

i believe that there are not so many people doing asm in D, and many of them using "write and forget" technique (i.e. write and don't touch if it works). so you need someone with good knowledge of backend to answer this question, and such people are rare here. ;-)

so i thing that your best bet is to investigate that by yourself, and write an article about it.

July 08, 2015
On Wednesday, 8 July 2015 at 05:22:34 UTC, ketmar wrote:
> On Tue, 07 Jul 2015 12:33:38 +0000, ponce wrote:
>
>> Is this secret knowledge?
>
> yes. ;-)
>
> i believe that there are not so many people doing asm in D, and many of them using "write and forget" technique (i.e. write and don't touch if it works). so you need someone with good knowledge of backend to answer this question, and such people are rare here. ;-)
>
> so i thing that your best bet is to investigate that by yourself, and write an article about it.

I would if I had time ;)

It looks that using XMM0 to XMM5 doesn't blow.

It would also help to know if the compiler insert spilling code if the asm code when some register is used that should not be modified by law. C++ compilers do that and it's both a performance hit and a safety net.