You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
E.g. The following instruction is perfectly valid AVX-512: VPSCATTERQQ Z7, K1, (Z8*1)
Avo currently enforces that all memory operands have a non-nil GP64 base register.
However for the VM(64/32)(x/y/z) memory operands used by the scatter/gather instructions, these checks are too strict, because as the above instruction shows, the Base register is optional for VM* memory operands.
I've tentatively modified the functions isvm() and VerifyMemOperands(...) to:
funcisvm(opOp, idxfunc(Op) bool) bool {
m, ok:=op.(Mem)
// return ok && IsR64(m.Base) && idx(m.Index)returnok&& (m.Base==nil||IsR64(m.Base)) &&idx(m.Index)
}
And:
// VerifyMemOperands checks the instruction's memory operands.funcVerifyMemOperands(i*ir.Instruction) error {
for_, op:=rangei.Operands {
m, ok:=op.(operand.Mem)
if!ok {
continue
}
// if m.Base == nil {ifm.Base==nil&&!(operand.IsVmx(m) ||operand.IsVmy(m) ||operand.IsVmz(m)) {
returnerrors.New("bad memory operand: missing base register")
}
ifm.Index!=nil&&m.Scale==0 {
returnerrors.New("bad memory operand: index register with scale 0")
}
}
returnnil
}
This seems to do the trick. I keep meaning to put together a PR with the AVX512_BITALG new instructions: VPOPCNTB/W and VPSHUFBITQMB. If the above fixes look okay, I'll fold them in as well.
The text was updated successfully, but these errors were encountered:
E.g. The following instruction is perfectly valid AVX-512:
VPSCATTERQQ Z7, K1, (Z8*1)
Avo currently enforces that all memory operands have a non-nil GP64 base register.
However for the VM(64/32)(x/y/z) memory operands used by the scatter/gather instructions, these checks are too strict, because as the above instruction shows, the Base register is optional for VM* memory operands.
I've tentatively modified the functions
isvm()
andVerifyMemOperands(...)
to:And:
This seems to do the trick. I keep meaning to put together a PR with the AVX512_BITALG new instructions: VPOPCNTB/W and VPSHUFBITQMB. If the above fixes look okay, I'll fold them in as well.
The text was updated successfully, but these errors were encountered: