(BEQZ (NEG x) yes no) => (BEQZ x yes no)
(BNEZ (NEG x) yes no) => (BNEZ x yes no)
+// Negate comparision with FNES/FNED.
+(BEQZ (FNES <t> x y) yes no) => (BNEZ (FEQS <t> x y) yes no)
+(BNEZ (FNES <t> x y) yes no) => (BEQZ (FEQS <t> x y) yes no)
+(BEQZ (FNED <t> x y) yes no) => (BNEZ (FEQD <t> x y) yes no)
+(BNEZ (FNED <t> x y) yes no) => (BEQZ (FEQD <t> x y) yes no)
+
// Convert BEQZ/BNEZ into more optimal branch conditions.
(BEQZ (SUB x y) yes no) => (BEQ x y yes no)
(BNEZ (SUB x y) yes no) => (BNE x y yes no)
b.resetWithControl(BlockRISCV64BEQZ, x)
return true
}
+ // match: (BEQZ (FNES <t> x y) yes no)
+ // result: (BNEZ (FEQS <t> x y) yes no)
+ for b.Controls[0].Op == OpRISCV64FNES {
+ v_0 := b.Controls[0]
+ t := v_0.Type
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
+ x := v_0_0
+ y := v_0_1
+ v0 := b.NewValue0(v_0.Pos, OpRISCV64FEQS, t)
+ v0.AddArg2(x, y)
+ b.resetWithControl(BlockRISCV64BNEZ, v0)
+ return true
+ }
+ }
+ // match: (BEQZ (FNED <t> x y) yes no)
+ // result: (BNEZ (FEQD <t> x y) yes no)
+ for b.Controls[0].Op == OpRISCV64FNED {
+ v_0 := b.Controls[0]
+ t := v_0.Type
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
+ x := v_0_0
+ y := v_0_1
+ v0 := b.NewValue0(v_0.Pos, OpRISCV64FEQD, t)
+ v0.AddArg2(x, y)
+ b.resetWithControl(BlockRISCV64BNEZ, v0)
+ return true
+ }
+ }
// match: (BEQZ (SUB x y) yes no)
// result: (BEQ x y yes no)
for b.Controls[0].Op == OpRISCV64SUB {
b.resetWithControl(BlockRISCV64BNEZ, x)
return true
}
+ // match: (BNEZ (FNES <t> x y) yes no)
+ // result: (BEQZ (FEQS <t> x y) yes no)
+ for b.Controls[0].Op == OpRISCV64FNES {
+ v_0 := b.Controls[0]
+ t := v_0.Type
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
+ x := v_0_0
+ y := v_0_1
+ v0 := b.NewValue0(v_0.Pos, OpRISCV64FEQS, t)
+ v0.AddArg2(x, y)
+ b.resetWithControl(BlockRISCV64BEQZ, v0)
+ return true
+ }
+ }
+ // match: (BNEZ (FNED <t> x y) yes no)
+ // result: (BEQZ (FEQD <t> x y) yes no)
+ for b.Controls[0].Op == OpRISCV64FNED {
+ v_0 := b.Controls[0]
+ t := v_0.Type
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
+ x := v_0_0
+ y := v_0_1
+ v0 := b.NewValue0(v_0.Pos, OpRISCV64FEQD, t)
+ v0.AddArg2(x, y)
+ b.resetWithControl(BlockRISCV64BEQZ, v0)
+ return true
+ }
+ }
// match: (BNEZ (SUB x y) yes no)
// result: (BNE x y yes no)
for b.Controls[0].Op == OpRISCV64SUB {