feat(asm): add the EVEX FP helper tail and gather/scatter with VSIB

Assisted-by: Qwen 3.8 Max Preview
This commit is contained in:
2026-07-19 15:58:48 +02:00
parent ee68859beb
commit 11f962fbcc
7 changed files with 356 additions and 8 deletions
+7 -1
View File
@@ -57,7 +57,7 @@ func (e *enc) encode(mnem string, ops []Operand) error {
if err != nil {
return err
}
if isVex(base) || isEvex(base) || isKOp(base) || base == "KMOVW" || base == "KMOVQ" {
if isVex(base) || isEvex(base) || isKOp(base) || isGather(base) || isScatter(base) || base == "KMOVW" || base == "KMOVQ" {
return e.encodeVec(base, ops, sfx)
}
if sfx.any() {
@@ -130,6 +130,12 @@ func splitSize(upper string) (base string, size int) {
// takes EVEX when an operand demands it (a ZMM or K register, or an
// EVEX-only mnemonic) and VEX otherwise.
func (e *enc) encodeVec(upper string, ops []Operand, sfx evexSuffix) error {
if gs, ok := gatherTable[upper]; ok {
return e.encodeGather(upper, gs, ops, sfx)
}
if ss, ok := scatterTable[upper]; ok {
return e.encodeScatter(upper, ss, ops, sfx)
}
if upper == "KMOVW" || upper == "KMOVQ" {
if sfx.any() {
return fmt.Errorf("%s takes no EVEX suffixes", upper)