www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Which XMM are safe to erase in asm{} blocks?

reply "ponce" <contact gam3sfrommars.fr> writes:
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;"
Jul 06 2015
parent reply "ponce" <contact gam3sfrommars.fr> writes:
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?
Jul 07 2015
parent reply ketmar <ketmar ketmar.no-ip.org> writes:
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=20 them using "write and forget" technique (i.e. write and don't touch if it=20 works). so you need someone with good knowledge of backend to answer this=20 question, and such people are rare here. ;-) so i thing that your best bet is to investigate that by yourself, and=20 write an article about it.=
Jul 07 2015
parent "ponce" <contact gam3sfrommars.fr> writes:
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.
Jul 08 2015