microcode = '''
def macroop BSR_R_R {
# Determine if the input was zero, and also move it to a temp reg.
- movi t1, t1, t0, dataSize=8
+ mov t1, t1, t0, dataSize=8
and t1, regm, regm, flags=(ZF,)
br label("end"), flags=(CZF,)
def macroop BSR_R_M {
- movi t1, t1, t0, dataSize=8
+ mov t1, t1, t0, dataSize=8
ld t1, seg, sib, disp
# Determine if the input was zero, and also move it to a temp reg.
def macroop BSR_R_P {
rdip t7
- movi t1, t1, t0, dataSize=8
+ mov t1, t1, t0, dataSize=8
ld t1, seg, riprel, disp
# Determine if the input was zero, and also move it to a temp reg.
# appropriate/other RIP checks.
# if temp_RIP > CS.limit throw #GP(0)
rdlimit t6, cs, dataSize=8
- subi t0, t1, t6, flags=(ECF,)
+ sub t0, t1, t6, flags=(ECF,)
fault "new GeneralProtection(0)", flags=(CECF,)
#(temp_CPL!=CPL)
limm t2, imm, dataSize=8
# Figure out the width of the offset.
limm t3, dsz, dataSize=8
- sll t3, t3, 3, dataSize=8
+ slli t3, t3, 3, dataSize=8
# Get the selector into t1.
sll t1, t2, t3, dataSize=8
mov t1, t0, t1, dataSize=2
limm t2, imm, dataSize=8
# Figure out the width of the offset.
limm t3, dsz, dataSize=8
- sll t3, t3, 3, dataSize=8
+ slli t3, t3, 3, dataSize=8
# Get the selector into t1.
sll t1, t2, t3, dataSize=8
mov t1, t0, t1, dataSize=2
# Pull the different components out of the immediate
limm t1, imm
zexti t2, t1, 15, dataSize=8
- srl t1, t1, 16
+ srli t1, t1, 16
zexti t1, t1, 5, dataSize=8
# t1 is now the masked nesting level, and t2 is the amount of storage.
mov t6, t6, rsp, dataSize=asz
# If the nesting level is zero, skip all this stuff.
- subi t0, t1, t0, flags=(EZF,), dataSize=2
+ sub t0, t1, t0, flags=(EZF,), dataSize=2
br label("skipLoop"), flags=(CEZF,)
# If the level was 1, only push the saved rbp
# Stick rflags with RF masked into r11.
rflags t2
limm t3, "~RFBit", dataSize=8
- andi r11, t2, t3, dataSize=8
+ and r11, t2, t3, dataSize=8
rdval t3, star
srli t3, t3, 32, dataSize=8
# Stick rflags with RF masked into r11.
rflags t2
limm t3, "~RFBit", dataSize=8
- andi r11, t2, t3, dataSize=8
+ and r11, t2, t3, dataSize=8
rdval t3, star
srli t3, t3, 32, dataSize=8