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

12
tests/cast/cast.s Normal file
View File

@@ -0,0 +1,12 @@
// Code generated by command: go run asm.go -out cast.s -stubs stub.go. DO NOT EDIT.
#include "textflag.h"
// func Split(x uint64) (q uint64, l uint32, w uint16, b uint8)
TEXT ·Split(SB), 0, $0-23
MOVQ x(FP), AX
MOVQ AX, q+8(FP)
MOVL AX, l+16(FP)
MOVW AX, w+20(FP)
MOVB AL, b+22(FP)
RET