rename some register types
This commit is contained in:
@@ -115,7 +115,7 @@ func IsYmm(op Op) bool {
|
|||||||
|
|
||||||
// IsRegisterKindSize returns true if op is a register of the given kind and size in bytes.
|
// IsRegisterKindSize returns true if op is a register of the given kind and size in bytes.
|
||||||
func IsRegisterKindSize(op Op, k reg.Kind, n uint) bool {
|
func IsRegisterKindSize(op Op, k reg.Kind, n uint) bool {
|
||||||
r, ok := op.(reg.Type)
|
r, ok := op.(reg.Register)
|
||||||
return ok && r.Kind() == k && r.Bytes() == n
|
return ok && r.Kind() == k && r.Bytes() == n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ type Op interface {
|
|||||||
|
|
||||||
type Mem struct {
|
type Mem struct {
|
||||||
Disp int
|
Disp int
|
||||||
Base reg.Register
|
Base reg.Physical
|
||||||
Index reg.Register
|
Index reg.Physical
|
||||||
Scale uint8
|
Scale uint8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
reg/types.go
12
reg/types.go
@@ -20,10 +20,10 @@ type Kind uint8
|
|||||||
|
|
||||||
type Family struct {
|
type Family struct {
|
||||||
Kind Kind
|
Kind Kind
|
||||||
registers []Register
|
registers []Physical
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Family) define(s Spec, id uint16, name string) Register {
|
func (f *Family) define(s Spec, id uint16, name string) Physical {
|
||||||
r := register{
|
r := register{
|
||||||
id: id,
|
id: id,
|
||||||
kind: f.Kind,
|
kind: f.Kind,
|
||||||
@@ -46,7 +46,7 @@ type private interface {
|
|||||||
private()
|
private()
|
||||||
}
|
}
|
||||||
|
|
||||||
type Type interface {
|
type Register interface {
|
||||||
Kind() Kind
|
Kind() Kind
|
||||||
Bytes() uint
|
Bytes() uint
|
||||||
Asm() string
|
Asm() string
|
||||||
@@ -55,7 +55,7 @@ type Type interface {
|
|||||||
|
|
||||||
type Virtual interface {
|
type Virtual interface {
|
||||||
VirtualID() uint16
|
VirtualID() uint16
|
||||||
Type
|
Register
|
||||||
}
|
}
|
||||||
|
|
||||||
type virtual struct {
|
type virtual struct {
|
||||||
@@ -74,10 +74,10 @@ func (v virtual) Asm() string {
|
|||||||
|
|
||||||
func (v virtual) private() {}
|
func (v virtual) private() {}
|
||||||
|
|
||||||
type Register interface {
|
type Physical interface {
|
||||||
PhysicalID() uint16
|
PhysicalID() uint16
|
||||||
Mask() uint16
|
Mask() uint16
|
||||||
Type
|
Register
|
||||||
}
|
}
|
||||||
|
|
||||||
type register struct {
|
type register struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user