x := v.Args[0].Reg()
y := v.Reg()
if v.Type.IsSIMD() {
- x = simdReg(v.Args[0])
- y = simdReg(v)
+ x = simdOrMaskReg(v.Args[0])
+ y = simdOrMaskReg(v)
}
if x != y {
opregreg(s, moveByType(v.Type), y, x)
p.To.Type = obj.TYPE_REG
r := v.Reg()
if v.Type.IsSIMD() {
- r = simdReg(v)
+ r = simdOrMaskReg(v)
}
p.To.Reg = r
}
r := v.Args[0].Reg()
if v.Type.IsSIMD() {
- r = simdReg(v.Args[0])
+ r = simdOrMaskReg(v.Args[0])
}
p := s.Prog(storeByType(v.Type))
p.From.Type = obj.TYPE_REG
func maskReg(v *ssa.Value) int16 {
t := v.Type
if !t.IsSIMD() {
- base.Fatalf("simdReg: not a simd type; v=%s, b=b%d, f=%s", v.LongString(), v.Block.ID, v.Block.Func.Name)
+ base.Fatalf("maskReg: not a simd type; v=%s, b=b%d, f=%s", v.LongString(), v.Block.ID, v.Block.Func.Name)
}
switch t.Size() {
case 8:
panic("unreachable")
}
+// XXX k mask + vec
+func simdOrMaskReg(v *ssa.Value) int16 {
+ t := v.Type
+ if t.Size() <= 8 {
+ return maskReg(v)
+ }
+ return simdReg(v)
+}
+
// XXX this is used for shift operations only.
// regalloc will issue OpCopy with incorrect type, but the assigned
// register should be correct, and this function is merely checking