Undefine and Redefine Registers

VRAL directives can be used only within the procedure, between the directives .proc and .endp. The variables declared by the directives are valid from their declaration till the end of the procedure or until they are undefined or redefined.

Use the following syntax to undefine variables, so the variable names can be used again within the procedure:

.vreg.undef Xcounter

Use the following syntax to redefine variables, with no need for undefining. Notice there is no opportunity to specify a different family:

.vreg.redef Xcounter

An example of the Virtual Registers Allocation (VRAL) directives usage is shown as follows.

Virtual Registers Allocation Example

.proc foo
.vreg.allocatable r19-r21, r27
.vreg.safe_across_calls r20, r21, p5-p6
.vreg.var @pred, HL1, L1H, HL2, L2H, HX, XH
.vreg.family MyGlobals, r19-r20
.vreg.var MyGlobals, High, Low1, Low2
foo::
alloc loc0 = 3,1,1,0
ld8 High = [in0]
ld8 Low1 = [in1];;
cmp.gt HL1, L1H = High, Low1
(L1H) br.cond.sptk.few LE
sub out0 = High, Low1
GT: add r22 = 32, r5;;
;  ...
END:
cmp.eq HX, XH = High, r22
(HX) br.call.spnt.many rp = bar;;
(XH) st8 [r23] = High
br.ret.sptk.clr b2
LE: ld8 Low2 = [in2] ;;
cmp.gt HL2, L2H = High, Low2
(HL2) sub out0 = High, Low2
(HL2) br.cond.sptk.few GT ;;
mov out0 = 0
;  ...
br.cond.sptk END
.endp foo