x86: rel types and generated tests

This commit is contained in:
Michael McLoughlin
2018-11-27 22:08:11 -08:00
parent 3881907ec8
commit 4395adacc8
13 changed files with 18188 additions and 19 deletions

View File

@@ -30,5 +30,19 @@ func (m Mem) Asm() string {
type Imm uint64
func (i Imm) Asm() string {
return fmt.Sprintf("%#x", uint64(i))
return fmt.Sprintf("%#x", i)
}
// Rel is an offset relative to the instruction pointer.
type Rel int32
func (r Rel) Asm() string {
return fmt.Sprintf(".%+d", r)
}
// LabelRef is a reference to a label.
type LabelRef string
func (l LabelRef) Asm() string {
return string(l)
}