add some encoding fields to Opcodes XML reader
This commit is contained in:
@@ -45,6 +45,7 @@ type Form struct {
|
|||||||
Operands []Operand `xml:"Operand"`
|
Operands []Operand `xml:"Operand"`
|
||||||
ImplicitOperands []ImplicitOperand `xml:"ImplicitOperand"`
|
ImplicitOperands []ImplicitOperand `xml:"ImplicitOperand"`
|
||||||
ISA []ISA `xml:"ISA"`
|
ISA []ISA `xml:"ISA"`
|
||||||
|
Encoding Encoding `xml:"Encoding"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Operand struct {
|
type Operand struct {
|
||||||
@@ -62,3 +63,45 @@ type ImplicitOperand struct {
|
|||||||
type ISA struct {
|
type ISA struct {
|
||||||
ID string `xml:"id,attr"`
|
ID string `xml:"id,attr"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Encoding struct {
|
||||||
|
REX *REX `xml:"REX"`
|
||||||
|
VEX *VEX `xml:"VEX"`
|
||||||
|
EVEX *EVEX `xml:"EVEX"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type REX struct {
|
||||||
|
Mandatory bool `xml:"mandatory,attr"`
|
||||||
|
W int `xml:"W,attr"`
|
||||||
|
R string `xml:"R,attr"`
|
||||||
|
X string `xml:"X,attr"`
|
||||||
|
B string `xml:"B,attr"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type VEX struct {
|
||||||
|
Type string `xml:"type,attr"`
|
||||||
|
W int `xml:"W,attr"`
|
||||||
|
L int `xml:"L,attr"`
|
||||||
|
M5 string `xml:"m-mmmm,attr"`
|
||||||
|
PP string `xml:"pp,attr"`
|
||||||
|
R string `xml:"R,attr"`
|
||||||
|
X string `xml:"X,attr"`
|
||||||
|
B string `xml:"B,attr"`
|
||||||
|
V4 string `xml:"vvvv,attr"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type EVEX struct {
|
||||||
|
M2 string `xml:"mm,attr"`
|
||||||
|
PP string `xml:"pp,attr"`
|
||||||
|
W int `xml:"W,attr"`
|
||||||
|
LL string `xml:"LL,attr"`
|
||||||
|
V4 string `xml:"vvvv,attr"`
|
||||||
|
V string `xml:"V,attr"`
|
||||||
|
RR string `xml:"RR,attr"`
|
||||||
|
B string `xml:"B,attr"`
|
||||||
|
X string `xml:"X,attr"`
|
||||||
|
Bsml string `xml:"b,attr"`
|
||||||
|
A3 string `xml:"aaa,attr"`
|
||||||
|
Z string `xml:"Z,attr"`
|
||||||
|
Disp8xN string `xml:"disp8xN,attr"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package opcodesxml
|
package opcodesxml
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestReadFile(t *testing.T) {
|
func TestReadFile(t *testing.T) {
|
||||||
is, err := ReadFile("testdata/x86_64.xml")
|
_, err := ReadFile("testdata/x86_64.xml")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
fmt.Printf("%#v\n", is)
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user