Add a NOT pseudo-instruction that translates to XORI $-1.
Change-Id: I2be4cfe2939e988cd7f8d30260b704701d78475f
Reviewed-on: https://go-review.googlesource.com/c/go/+/221688
Reviewed-by: Cherry Zhang <cherryyz@google.com>
MOVD F0, 4(X5) // 27b20200
MOVD F0, F1 // d3000022
+ // NOT pseudo-instruction
+ NOT X5 // 93c2f2ff
+ NOT X5, X6 // 13c3f2ff
+
// These jumps can get printed as jumps to 2 because they go to the
// second instruction in the function (the first instruction is an
// invisible stack pointer adjustment).
- JMP start // JMP 2 // 6ff09fc6
+ JMP start // JMP 2 // 6ff01fc6
JMP (X5) // 67800200
JMP 4(X5) // 67804200
"MOVHU",
"MOVW",
"MOVWU",
+ "NOT",
"SEQZ",
"SNEZ",
"LAST",
AMOVHU
AMOVW
AMOVWU
+ ANOT
ASEQZ
ASNEZ
ins.rs1 = uint32(p.From.Reg)
ins.rs2 = REG_F0
+ case ANOT:
+ // NOT rs, rd -> XORI $-1, rs, rd
+ ins.as = AXORI
+ ins.rs1, ins.rs2 = uint32(p.From.Reg), obj.REG_NONE
+ if ins.rd == obj.REG_NONE {
+ ins.rd = ins.rs1
+ }
+ ins.imm = -1
+
case ASEQZ:
// SEQZ rs, rd -> SLTIU $1, rs, rd
ins.as = ASLTIU