package ssa
-import "cmd/internal/objabi"
-import "cmd/compile/internal/types"
+import (
+ "cmd/compile/internal/types"
+ "internal/buildcfg"
+)
func rewriteValueARM(v *Value) bool {
switch v.Op {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (ADDD a (MULD x y))
- // cond: a.Uses == 1 && objabi.GOARM >= 6
+ // cond: a.Uses == 1 && buildcfg.GOARM >= 6
// result: (MULAD a x y)
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
}
y := v_1.Args[1]
x := v_1.Args[0]
- if !(a.Uses == 1 && objabi.GOARM >= 6) {
+ if !(a.Uses == 1 && buildcfg.GOARM >= 6) {
continue
}
v.reset(OpARMMULAD)
break
}
// match: (ADDD a (NMULD x y))
- // cond: a.Uses == 1 && objabi.GOARM >= 6
+ // cond: a.Uses == 1 && buildcfg.GOARM >= 6
// result: (MULSD a x y)
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
}
y := v_1.Args[1]
x := v_1.Args[0]
- if !(a.Uses == 1 && objabi.GOARM >= 6) {
+ if !(a.Uses == 1 && buildcfg.GOARM >= 6) {
continue
}
v.reset(OpARMMULSD)
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (ADDF a (MULF x y))
- // cond: a.Uses == 1 && objabi.GOARM >= 6
+ // cond: a.Uses == 1 && buildcfg.GOARM >= 6
// result: (MULAF a x y)
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
}
y := v_1.Args[1]
x := v_1.Args[0]
- if !(a.Uses == 1 && objabi.GOARM >= 6) {
+ if !(a.Uses == 1 && buildcfg.GOARM >= 6) {
continue
}
v.reset(OpARMMULAF)
break
}
// match: (ADDF a (NMULF x y))
- // cond: a.Uses == 1 && objabi.GOARM >= 6
+ // cond: a.Uses == 1 && buildcfg.GOARM >= 6
// result: (MULSF a x y)
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
}
y := v_1.Args[1]
x := v_1.Args[0]
- if !(a.Uses == 1 && objabi.GOARM >= 6) {
+ if !(a.Uses == 1 && buildcfg.GOARM >= 6) {
continue
}
v.reset(OpARMMULSF)
return true
}
// match: (ADDconst [c] x)
- // cond: objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && uint32(-c)<=0xffff
+ // cond: buildcfg.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && uint32(-c)<=0xffff
// result: (SUBconst [-c] x)
for {
c := auxIntToInt32(v.AuxInt)
x := v_0
- if !(objabi.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && uint32(-c) <= 0xffff) {
+ if !(buildcfg.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && uint32(-c) <= 0xffff) {
break
}
v.reset(OpARMSUBconst)
return true
}
// match: (ADDshiftLL <typ.UInt16> [8] (SRLconst <typ.UInt16> [24] (SLLconst [16] x)) x)
- // cond: objabi.GOARM>=6
+ // cond: buildcfg.GOARM>=6
// result: (REV16 x)
for {
if v.Type != typ.UInt16 || auxIntToInt32(v.AuxInt) != 8 || v_0.Op != OpARMSRLconst || v_0.Type != typ.UInt16 || auxIntToInt32(v_0.AuxInt) != 24 {
break
}
x := v_0_0.Args[0]
- if x != v_1 || !(objabi.GOARM >= 6) {
+ if x != v_1 || !(buildcfg.GOARM >= 6) {
break
}
v.reset(OpARMREV16)
return true
}
// match: (ANDconst [c] x)
- // cond: objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && ^uint32(c)<=0xffff
+ // cond: buildcfg.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && ^uint32(c)<=0xffff
// result: (BICconst [int32(^uint32(c))] x)
for {
c := auxIntToInt32(v.AuxInt)
x := v_0
- if !(objabi.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && ^uint32(c) <= 0xffff) {
+ if !(buildcfg.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && ^uint32(c) <= 0xffff) {
break
}
v.reset(OpARMBICconst)
return true
}
// match: (BICconst [c] x)
- // cond: objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && ^uint32(c)<=0xffff
+ // cond: buildcfg.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && ^uint32(c)<=0xffff
// result: (ANDconst [int32(^uint32(c))] x)
for {
c := auxIntToInt32(v.AuxInt)
x := v_0
- if !(objabi.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && ^uint32(c) <= 0xffff) {
+ if !(buildcfg.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && ^uint32(c) <= 0xffff) {
break
}
v.reset(OpARMANDconst)
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (MULD (NEGD x) y)
- // cond: objabi.GOARM >= 6
+ // cond: buildcfg.GOARM >= 6
// result: (NMULD x y)
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
}
x := v_0.Args[0]
y := v_1
- if !(objabi.GOARM >= 6) {
+ if !(buildcfg.GOARM >= 6) {
continue
}
v.reset(OpARMNMULD)
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (MULF (NEGF x) y)
- // cond: objabi.GOARM >= 6
+ // cond: buildcfg.GOARM >= 6
// result: (NMULF x y)
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
}
x := v_0.Args[0]
y := v_1
- if !(objabi.GOARM >= 6) {
+ if !(buildcfg.GOARM >= 6) {
continue
}
v.reset(OpARMNMULF)
func rewriteValueARM_OpARMNEGD(v *Value) bool {
v_0 := v.Args[0]
// match: (NEGD (MULD x y))
- // cond: objabi.GOARM >= 6
+ // cond: buildcfg.GOARM >= 6
// result: (NMULD x y)
for {
if v_0.Op != OpARMMULD {
}
y := v_0.Args[1]
x := v_0.Args[0]
- if !(objabi.GOARM >= 6) {
+ if !(buildcfg.GOARM >= 6) {
break
}
v.reset(OpARMNMULD)
func rewriteValueARM_OpARMNEGF(v *Value) bool {
v_0 := v.Args[0]
// match: (NEGF (MULF x y))
- // cond: objabi.GOARM >= 6
+ // cond: buildcfg.GOARM >= 6
// result: (NMULF x y)
for {
if v_0.Op != OpARMMULF {
}
y := v_0.Args[1]
x := v_0.Args[0]
- if !(objabi.GOARM >= 6) {
+ if !(buildcfg.GOARM >= 6) {
break
}
v.reset(OpARMNMULF)
return true
}
// match: (ORshiftLL <typ.UInt16> [8] (SRLconst <typ.UInt16> [24] (SLLconst [16] x)) x)
- // cond: objabi.GOARM>=6
+ // cond: buildcfg.GOARM>=6
// result: (REV16 x)
for {
if v.Type != typ.UInt16 || auxIntToInt32(v.AuxInt) != 8 || v_0.Op != OpARMSRLconst || v_0.Type != typ.UInt16 || auxIntToInt32(v_0.AuxInt) != 24 {
break
}
x := v_0_0.Args[0]
- if x != v_1 || !(objabi.GOARM >= 6) {
+ if x != v_1 || !(buildcfg.GOARM >= 6) {
break
}
v.reset(OpARMREV16)
return true
}
// match: (RSB (MUL x y) a)
- // cond: objabi.GOARM == 7
+ // cond: buildcfg.GOARM == 7
// result: (MULS x y a)
for {
if v_0.Op != OpARMMUL {
y := v_0.Args[1]
x := v_0.Args[0]
a := v_1
- if !(objabi.GOARM == 7) {
+ if !(buildcfg.GOARM == 7) {
break
}
v.reset(OpARMMULS)
return true
}
// match: (SRAconst (SLLconst x [c]) [d])
- // cond: objabi.GOARM==7 && uint64(d)>=uint64(c) && uint64(d)<=31
+ // cond: buildcfg.GOARM==7 && uint64(d)>=uint64(c) && uint64(d)<=31
// result: (BFX [(d-c)|(32-d)<<8] x)
for {
d := auxIntToInt32(v.AuxInt)
}
c := auxIntToInt32(v_0.AuxInt)
x := v_0.Args[0]
- if !(objabi.GOARM == 7 && uint64(d) >= uint64(c) && uint64(d) <= 31) {
+ if !(buildcfg.GOARM == 7 && uint64(d) >= uint64(c) && uint64(d) <= 31) {
break
}
v.reset(OpARMBFX)
return true
}
// match: (SRLconst (SLLconst x [c]) [d])
- // cond: objabi.GOARM==7 && uint64(d)>=uint64(c) && uint64(d)<=31
+ // cond: buildcfg.GOARM==7 && uint64(d)>=uint64(c) && uint64(d)<=31
// result: (BFXU [(d-c)|(32-d)<<8] x)
for {
d := auxIntToInt32(v.AuxInt)
}
c := auxIntToInt32(v_0.AuxInt)
x := v_0.Args[0]
- if !(objabi.GOARM == 7 && uint64(d) >= uint64(c) && uint64(d) <= 31) {
+ if !(buildcfg.GOARM == 7 && uint64(d) >= uint64(c) && uint64(d) <= 31) {
break
}
v.reset(OpARMBFXU)
return true
}
// match: (SUB a (MUL x y))
- // cond: objabi.GOARM == 7
+ // cond: buildcfg.GOARM == 7
// result: (MULS x y a)
for {
a := v_0
}
y := v_1.Args[1]
x := v_1.Args[0]
- if !(objabi.GOARM == 7) {
+ if !(buildcfg.GOARM == 7) {
break
}
v.reset(OpARMMULS)
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (SUBD a (MULD x y))
- // cond: a.Uses == 1 && objabi.GOARM >= 6
+ // cond: a.Uses == 1 && buildcfg.GOARM >= 6
// result: (MULSD a x y)
for {
a := v_0
}
y := v_1.Args[1]
x := v_1.Args[0]
- if !(a.Uses == 1 && objabi.GOARM >= 6) {
+ if !(a.Uses == 1 && buildcfg.GOARM >= 6) {
break
}
v.reset(OpARMMULSD)
return true
}
// match: (SUBD a (NMULD x y))
- // cond: a.Uses == 1 && objabi.GOARM >= 6
+ // cond: a.Uses == 1 && buildcfg.GOARM >= 6
// result: (MULAD a x y)
for {
a := v_0
}
y := v_1.Args[1]
x := v_1.Args[0]
- if !(a.Uses == 1 && objabi.GOARM >= 6) {
+ if !(a.Uses == 1 && buildcfg.GOARM >= 6) {
break
}
v.reset(OpARMMULAD)
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (SUBF a (MULF x y))
- // cond: a.Uses == 1 && objabi.GOARM >= 6
+ // cond: a.Uses == 1 && buildcfg.GOARM >= 6
// result: (MULSF a x y)
for {
a := v_0
}
y := v_1.Args[1]
x := v_1.Args[0]
- if !(a.Uses == 1 && objabi.GOARM >= 6) {
+ if !(a.Uses == 1 && buildcfg.GOARM >= 6) {
break
}
v.reset(OpARMMULSF)
return true
}
// match: (SUBF a (NMULF x y))
- // cond: a.Uses == 1 && objabi.GOARM >= 6
+ // cond: a.Uses == 1 && buildcfg.GOARM >= 6
// result: (MULAF a x y)
for {
a := v_0
}
y := v_1.Args[1]
x := v_1.Args[0]
- if !(a.Uses == 1 && objabi.GOARM >= 6) {
+ if !(a.Uses == 1 && buildcfg.GOARM >= 6) {
break
}
v.reset(OpARMMULAF)
return true
}
// match: (SUBconst [c] x)
- // cond: objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && uint32(-c)<=0xffff
+ // cond: buildcfg.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && uint32(-c)<=0xffff
// result: (ADDconst [-c] x)
for {
c := auxIntToInt32(v.AuxInt)
x := v_0
- if !(objabi.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && uint32(-c) <= 0xffff) {
+ if !(buildcfg.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && uint32(-c) <= 0xffff) {
break
}
v.reset(OpARMADDconst)
return true
}
// match: (XORshiftLL <typ.UInt16> [8] (SRLconst <typ.UInt16> [24] (SLLconst [16] x)) x)
- // cond: objabi.GOARM>=6
+ // cond: buildcfg.GOARM>=6
// result: (REV16 x)
for {
if v.Type != typ.UInt16 || auxIntToInt32(v.AuxInt) != 8 || v_0.Op != OpARMSRLconst || v_0.Type != typ.UInt16 || auxIntToInt32(v_0.AuxInt) != 24 {
break
}
x := v_0_0.Args[0]
- if x != v_1 || !(objabi.GOARM >= 6) {
+ if x != v_1 || !(buildcfg.GOARM >= 6) {
break
}
v.reset(OpARMREV16)
v_0 := v.Args[0]
b := v.Block
// match: (Bswap32 <t> x)
- // cond: objabi.GOARM==5
+ // cond: buildcfg.GOARM==5
// result: (XOR <t> (SRLconst <t> (BICconst <t> (XOR <t> x (SRRconst <t> [16] x)) [0xff0000]) [8]) (SRRconst <t> x [8]))
for {
t := v.Type
x := v_0
- if !(objabi.GOARM == 5) {
+ if !(buildcfg.GOARM == 5) {
break
}
v.reset(OpARMXOR)
return true
}
// match: (Bswap32 x)
- // cond: objabi.GOARM>=6
+ // cond: buildcfg.GOARM>=6
// result: (REV x)
for {
x := v_0
- if !(objabi.GOARM >= 6) {
+ if !(buildcfg.GOARM >= 6) {
break
}
v.reset(OpARMREV)
b := v.Block
typ := &b.Func.Config.Types
// match: (Ctz16 <t> x)
- // cond: objabi.GOARM<=6
+ // cond: buildcfg.GOARM<=6
// result: (RSBconst [32] (CLZ <t> (SUBconst <typ.UInt32> (AND <typ.UInt32> (ORconst <typ.UInt32> [0x10000] x) (RSBconst <typ.UInt32> [0] (ORconst <typ.UInt32> [0x10000] x))) [1])))
for {
t := v.Type
x := v_0
- if !(objabi.GOARM <= 6) {
+ if !(buildcfg.GOARM <= 6) {
break
}
v.reset(OpARMRSBconst)
return true
}
// match: (Ctz16 <t> x)
- // cond: objabi.GOARM==7
+ // cond: buildcfg.GOARM==7
// result: (CLZ <t> (RBIT <typ.UInt32> (ORconst <typ.UInt32> [0x10000] x)))
for {
t := v.Type
x := v_0
- if !(objabi.GOARM == 7) {
+ if !(buildcfg.GOARM == 7) {
break
}
v.reset(OpARMCLZ)
v_0 := v.Args[0]
b := v.Block
// match: (Ctz32 <t> x)
- // cond: objabi.GOARM<=6
+ // cond: buildcfg.GOARM<=6
// result: (RSBconst [32] (CLZ <t> (SUBconst <t> (AND <t> x (RSBconst <t> [0] x)) [1])))
for {
t := v.Type
x := v_0
- if !(objabi.GOARM <= 6) {
+ if !(buildcfg.GOARM <= 6) {
break
}
v.reset(OpARMRSBconst)
return true
}
// match: (Ctz32 <t> x)
- // cond: objabi.GOARM==7
+ // cond: buildcfg.GOARM==7
// result: (CLZ <t> (RBIT <t> x))
for {
t := v.Type
x := v_0
- if !(objabi.GOARM == 7) {
+ if !(buildcfg.GOARM == 7) {
break
}
v.reset(OpARMCLZ)
b := v.Block
typ := &b.Func.Config.Types
// match: (Ctz8 <t> x)
- // cond: objabi.GOARM<=6
+ // cond: buildcfg.GOARM<=6
// result: (RSBconst [32] (CLZ <t> (SUBconst <typ.UInt32> (AND <typ.UInt32> (ORconst <typ.UInt32> [0x100] x) (RSBconst <typ.UInt32> [0] (ORconst <typ.UInt32> [0x100] x))) [1])))
for {
t := v.Type
x := v_0
- if !(objabi.GOARM <= 6) {
+ if !(buildcfg.GOARM <= 6) {
break
}
v.reset(OpARMRSBconst)
return true
}
// match: (Ctz8 <t> x)
- // cond: objabi.GOARM==7
+ // cond: buildcfg.GOARM==7
// result: (CLZ <t> (RBIT <typ.UInt32> (ORconst <typ.UInt32> [0x100] x)))
for {
t := v.Type
x := v_0
- if !(objabi.GOARM == 7) {
+ if !(buildcfg.GOARM == 7) {
break
}
v.reset(OpARMCLZ)