thanks a lot. There isn't too much info in this document either.
So, for example, what does
mov r0, r1.wzxy_neg(zw)
Is the neg-operator pre- or post-swizzle?
Plus, will a neg-operator consume additional clock cycles?
Sorry, found it myself:
swizzle takes precedence over neg.
Additional question I would have:
What's the correct way of using neg() for double-precision operands?
Also, are there literals for double-precision constants?
If you have a look at the ASM docs (Evergreen Family ISA), you'll get a better idea of what the modifier does. In general, it flips the MSB of the channel specified (post swizzle).
The specific rules I have worked out by trial and error are:
- neg modifier on integer operations produces a ineg and then the operation (or an isub equivalent if on an iadd instruction).
- neg modifier on float instructions works as expected (flips MSB)
- neg modifier on non-float instructions (eg mov, cmov) works as float.
- To get neg modifier working on double, you need _neg(y) or _neg(yw) which acts on the 64bit MSB (little endian).
Note that the same rules seem to apply to the abs modifier. Many of the other modifiers will make no sense for integer operations (eg _bx2), although I doubt the IL compiler will complain (it is not always self consistent in behaviour).