Re: Phix: #ilasm
- Posted by petelomax 3 days ago
- 106 views
No disagreement from me with any of that.
Phix c_func/proc are decidedly hacky and I've long wanted to replace them but no real idea what with,
in fact I've toyed with the idea of forcing the use of asm code snippets just like those you posted.
Ideally perhaps the compiler should be smart enough to generate them itself, but that's not trivial.
There is indeed no support as yet for pxor or cvtsi2ss, pilasm.e has been written in an ad hoc fashion,
but is reasonably straightforward to extend, especially if you can find something similar to crib from.
I typically fire up OllyDbg/fdbg/edb, see what binary that assembles summat to and ensure I match that.
There are somewhere between 981 and 3,600 x86 instructions, in fact LLVM says there are 14,600 variants,
and just about the last thing I would ever want to do is add several hundred completely untested ones.
Mind you, it looks for all the world to me those pxor/cvtsi2ss are completely pointless instructions that
leave eax and ecx exactly as they found them...
If you were having a problem with the direct call, I'm pretty sure they need the ".dll" and it must be
located somewhere in %PATH% for the Windows program loader to find it.
If you can guarantee the result of V2toReg() is an integer, maybe and_bits(#FFFFFFFF), ditch LoadMint.
There may be an AGI stall on rax, try loading it first see if that helps (or eg call rsi while rax used for "")
If you only need to call DrawPixelV from a few places and can bear to copy that asm there, it should
also make a measurable difference.

