cmd/asm: add missing s390x branch/move on condition suffixes and improve consistency #19483
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
I'd like the compiler to be able to generate test-under-mask instructions (TMLL, TMLH, TMHL and TMHH) for s390x. To do this properly the SSA backend needs to be able to deal with (and be able to reverse) all 14 useful condition codes, rather than just the 9 it currently handles. We don't currently have suffixes for all these condition codes and in the process of adding them I'm wondering whether to also try and make the existing ones more consistent with their GNU assembler (GAS) equivalents.
The exact meaning of the bits set in the condition code vary from instruction to instruction. For example, bit 3 set by test-under-mask means 'selected bits are all ones'. However in general they correspond to the following (big endian, so 0 is MSB, 3 is LSB):
Here are my proposed changes:
I also like the idea of making each suffix exactly two characters long, but I suspect it is better to stick more closely to GAS. If every suffix were to be two characters, I would substitute as follows:
O
->OV
(overflow)NGE
->LO
(less than or overflow)NLE
->GO
(greater than or overflow)NLG
->EO
(equal or overflow)We'd need to decide whether to keep the current mnemonics around as aliases or not. I think we should keep
BVS
but the rest can probably go.We could replace
GT
withH
,EQ
withE
and so on but that feels like a step too far. These suffixes are more widely used than the overflow ones andH
would conflict with our uses ofH
for half-word.The text was updated successfully, but these errors were encountered: