reg: support for register casting

Adds methods for referencing sub- or super-registers. For example, for
general purpose registers you can now reference As8(), As16(), ... and
for vector AsX(), AsY(), AsZ().

Closes #1
This commit is contained in:
Michael McLoughlin
2018-12-30 18:40:45 -08:00
parent 4644d996ee
commit 18cdf50d7c
16 changed files with 558 additions and 244 deletions

View File

@@ -10,7 +10,7 @@ func TestAllocatorSimple(t *testing.T) {
c := reg.NewCollection()
x, y := c.Xv(), c.Yv()
a, err := NewAllocatorForKind(reg.SSEAVX)
a, err := NewAllocatorForKind(reg.KindVector)
if err != nil {
t.Fatal(err)
}
@@ -32,7 +32,7 @@ func TestAllocatorSimple(t *testing.T) {
}
func TestAllocatorImpossible(t *testing.T) {
a, err := NewAllocatorForKind(reg.SSEAVX)
a, err := NewAllocatorForKind(reg.KindVector)
if err != nil {
t.Fatal(err)
}