feat(amd64): encode legacy SSE packed binaries and imm8 shuffles
Test / vet (push) Successful in 47s
Test / test (push) Successful in 2m34s
Test / build (push) Successful in 41s

This commit is contained in:
2026-08-27 17:15:10 +02:00
parent 941f7fa990
commit be2ceaafb9
4 changed files with 154 additions and 0 deletions
+11
View File
@@ -76,6 +76,17 @@ func (e *enc) encode(mnem string, ops []Operand) error {
if size == 0 {
size = 8 // default operand size in 64-bit mode (e.g. PUSHQ)
}
// Legacy SSE imm8 shuffles whose names end in W/H (PSHUFLW,
// PSHUFHW) must dispatch BEFORE the size-suffix split, and the
// others ride along.
if m, ok := sseShufTable[upper]; ok {
return e.encodeSSEShuf(m, ops)
}
// Legacy SSE packed binary ops and imm8 shuffles (ADDPS/MULPS/
// SHUFPS/PSHUFD/...): no size suffix, dispatch on the full name.
if m, ok := sseBinTable[base]; ok {
return e.encodeSSEBin(m, ops)
}
switch base {
case "MOV":
return e.encodeMov(ops, size)