# first split imm into d1, d0 and d2. sigh
d2 = (imm & 1) # LSB (0)
d1 = (imm >> 1) & 0b11111 # bits 1-5
- d0 = (imm >> 6) # MSBs 6-15
+ d0 = (imm >> 5) # MSBs 6-15
return instruction(
(PO , 0 , 5),
(FRS, 6 , 10),
- (d1, 11, 15),
- (d0, 16, 26),
+ (d1, 11, 15),
+ (d0, 16, 26),
(XO , 27, 30),
(d2 , 31, 31),
)
def case_0_fmvis(self):
lst = SVP64Asm(["fmvis 5, 0x4000", # 2.0
- "fmvis 6, 0x2122",
+ "fmvis 6, 0x4048", # 3.125
"fmvis 7, 0x3E80", # 0.25
])
lst = list(lst)
- expected_fprs = [0] * 64
+ expected_fprs = [0] * 32
expected_fprs[5] = 0x4000000000000000 # 2.0 in FP64 form
- expected_fprs[6] = 0x2122000000000000
+ expected_fprs[6] = 0x4009000000000000 # 3.125 in FP64 form
expected_fprs[7] = 0x3FD0000000000000 # 0.25 in FP64 form
e = ExpectedState(pc=0xc, # 3 instructions so 3x4=0xc
fp_regs=expected_fprs) # expected results