m256 arguments, MMX exception

This commit is contained in:
Michael McLoughlin
2018-11-22 15:24:28 -06:00
parent 1f20eae901
commit 27235485a6
2 changed files with 25 additions and 14 deletions

View File

@@ -86,18 +86,18 @@ func arg(t string) string {
"imm32": fmt.Sprintf("$%d", math.MaxInt32), // <xs:enumeration value="imm32" /> "imm32": fmt.Sprintf("$%d", math.MaxInt32), // <xs:enumeration value="imm32" />
"imm64": fmt.Sprintf("$%d", math.MaxInt64), // <xs:enumeration value="imm64" /> "imm64": fmt.Sprintf("$%d", math.MaxInt64), // <xs:enumeration value="imm64" />
"al": "AL", // <xs:enumeration value="al" /> "al": "AL", // <xs:enumeration value="al" />
"cl": "CL", // <xs:enumeration value="cl" /> "cl": "CL", // <xs:enumeration value="cl" />
"r8": "CH", // <xs:enumeration value="r8" /> "r8": "CH", // <xs:enumeration value="r8" />
"ax": "AX", // <xs:enumeration value="ax" /> "ax": "AX", // <xs:enumeration value="ax" />
"r16": "SI", // <xs:enumeration value="r16" /> "r16": "SI", // <xs:enumeration value="r16" />
"eax": "AX", // <xs:enumeration value="eax" /> "eax": "AX", // <xs:enumeration value="eax" />
"r32": "DX", // <xs:enumeration value="r32" /> "r32": "DX", // <xs:enumeration value="r32" />
"rax": "AX", // <xs:enumeration value="rax" /> "rax": "AX", // <xs:enumeration value="rax" />
"r64": "R15", // <xs:enumeration value="r64" /> "r64": "R15", // <xs:enumeration value="r64" />
// <xs:enumeration value="mm" /> "mm": "M5", // <xs:enumeration value="mm" />
"xmm0": "X0", // <xs:enumeration value="xmm0" /> "xmm0": "X0", // <xs:enumeration value="xmm0" />
"xmm": "X7", // <xs:enumeration value="xmm" /> "xmm": "X7", // <xs:enumeration value="xmm" />
// <xs:enumeration value="xmm{k}" /> // <xs:enumeration value="xmm{k}" />
// <xs:enumeration value="xmm{k}{z}" /> // <xs:enumeration value="xmm{k}{z}" />
"ymm": "Y13", // <xs:enumeration value="ymm" /> "ymm": "Y13", // <xs:enumeration value="ymm" />
@@ -122,7 +122,7 @@ func arg(t string) string {
// <xs:enumeration value="m64{k}{z}" /> // <xs:enumeration value="m64{k}{z}" />
"m128": "128(AX)(CX*2)", // <xs:enumeration value="m128" /> "m128": "128(AX)(CX*2)", // <xs:enumeration value="m128" />
// <xs:enumeration value="m128{k}{z}" /> // <xs:enumeration value="m128{k}{z}" />
// <xs:enumeration value="m256" /> "m256": "256(AX)(CX*2)", // <xs:enumeration value="m256" />
// <xs:enumeration value="m256{k}{z}" /> // <xs:enumeration value="m256{k}{z}" />
// <xs:enumeration value="m512" /> // <xs:enumeration value="m512" />
// <xs:enumeration value="m512{k}{z}" /> // <xs:enumeration value="m512{k}{z}" />

View File

@@ -97,7 +97,7 @@ func (l Loader) include(f opcodesxml.Form) bool {
for _, isa := range f.ISA { for _, isa := range f.ISA {
switch isa.ID { switch isa.ID {
// AMD-only. // AMD-only.
case "TBM", "CLZERO", "FMA4", "XOP", "SSE4A": case "TBM", "CLZERO", "FMA4", "XOP", "SSE4A", "3dnow!", "3dnow!+":
return false return false
// Incomplete support for some prefetching instructions. // Incomplete support for some prefetching instructions.
case "PREFETCH", "PREFETCHW", "PREFETCHWT1", "CLWB": case "PREFETCH", "PREFETCHW", "PREFETCHWT1", "CLWB":
@@ -113,6 +113,17 @@ func (l Loader) include(f opcodesxml.Form) bool {
} }
} }
// Go appears to have skeleton support for MMX instructions. See the many TODO lines in the testcases:
// Reference: https://github.com/golang/go/blob/649b89377e91ad6dbe710784f9e662082d31a1ff/src/cmd/asm/internal/asm/testdata/amd64enc.s#L3310-L3312
//
// //TODO: PALIGNR $7, (BX), M2 // 0f3a0f1307
// //TODO: PALIGNR $7, (R11), M2 // 410f3a0f1307
// //TODO: PALIGNR $7, M2, M2 // 0f3a0fd207
//
if f.MMXMode == "MMX" {
return false
}
// x86 csv contains a number of CMOV* instructions which are actually not valid // x86 csv contains a number of CMOV* instructions which are actually not valid
// Go instructions. The valid Go forms should have different opcodes from GNU. // Go instructions. The valid Go forms should have different opcodes from GNU.
// Therefore a decent "heuristic" is CMOV* instructions that do not have // Therefore a decent "heuristic" is CMOV* instructions that do not have