handle xmm instructions

This commit is contained in:
Michael McLoughlin
2018-11-21 22:28:55 -06:00
parent 836252fa13
commit c30d7fb743
4 changed files with 73 additions and 29 deletions

View File

@@ -8,8 +8,9 @@ import (
)
type Alias struct {
Opcode string
DataSize int
Opcode string
DataSize int
NumOperands int
}
// BuildAliasMap constructs a map from AT&T/GNU/Intel to Go syntax.
@@ -21,9 +22,18 @@ func BuildAliasMap(is []*x86csv.Inst) (map[Alias]string, error) {
return nil, err
}
if strings.Contains(i.GoOpcode(), "/") {
continue
}
for _, alt := range []string{i.IntelOpcode(), i.GNUOpcode()} {
if strings.ToUpper(alt) != i.GoOpcode() {
m[Alias{Opcode: strings.ToLower(alt), DataSize: s}] = i.GoOpcode()
a := Alias{
Opcode: strings.ToLower(alt),
DataSize: s,
NumOperands: len(i.GoArgs()),
}
m[a] = i.GoOpcode()
}
}
}