feat(arch): add the amd64 fp16 packed imm8-control group

Assisted-by: GLM 5.3
This commit is contained in:
petrbalvin committed 2026-10-07 13:51:48 +02:00
1 parent 8de1b371da
commit d03de62c07
4 files changed
+158 -10

No files matched your search

+8 -2
View File
@@ -55,6 +55,9 @@ func TestAmd64ExtensionRegistry(t *testing.T) {
{"VCVTUQQ2PH", 3},
{"VCVTPH2PD", 3},
{"VCVTPD2PH", 3},
{"VRNDSCALEPH", 3},
{"VREDUCEPH", 3},
{"VGETMANTPH", 3},
} {
cands, ok := LookupExtension(arch.AMD64, tt.mnem)
if !ok {
@@ -68,8 +71,8 @@ func TestAmd64ExtensionRegistry(t *testing.T) {
t.Errorf("the %s lookup is not case-insensitive", tt.mnem)
}
}
if got := arch.Extensions(arch.AMD64); len(got) != 112 {
t.Errorf("the amd64 layer registers %d instructions, want 112", len(got))
if got := arch.Extensions(arch.AMD64); len(got) != 121 {
t.Errorf("the amd64 layer registers %d instructions, want 121", len(got))
}
if _, ok := LookupExtension(arch.AMD64, "NOSUCHINSTR"); ok {
t.Error("a non-extended mnemonic resolved")
@@ -160,6 +163,9 @@ func TestEncodeExtensionAmd64(t *testing.T) {
{"fp16 to double-precision, widened", "VCVTPH2PD",
[]arch.ExtOperand{arch.ExtXmm(5), arch.ExtZmm(6)},
"62f57c485af5"},
{"packed fp16 rounding to fraction bits", "VRNDSCALEPH",
[]arch.ExtOperand{arch.ExtImmediate(0x7b), arch.ExtZmm(5), arch.ExtZmm(6)},
"62f37c4808f57b"},
} {
got, err := EncodeExtension(arch.AMD64, tt.mnem, tt.ops...)
if err != nil {