Special Registers Altered:
None
+
+# Float Replace Lower-Half Single, Immediate
+
+DX-Form
+
+* fishmv FRS,D
+
+Pseudo-code:
+
+ LH <- FRS[0:15]
+ fp32 <- LH || d0 || d1 || d2
+ n <- DOUBLE(fp32)
+ FRS <- LH || n[16:63]
+
+Special Registers Altered:
+
+ None
0110001110-,ALU,OP_CPROP,RA,RB,NONE,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,0,0,RC,0,0,cprop,X,,1,unofficial until submitted and approved/renumbered by the opf isa wg
------10001,ALU,OP_BMASK,RA,RB,NONE,RT,NONE,NONE,0,0,ZERO,0,NONE,0,0,0,0,0,0,NONE,0,0,bmask,BM2,,1,unofficial until submitted and approved/renumbered by the opf isa wg
-----00011-,ALU,OP_FMVIS,NONE,CONST_UI,NONE,FRS,NONE,NONE,0,0,ZERO,0,NONE,0,0,0,0,0,0,NONE,0,0,fmvis,DX,,1,unofficial until submitted and approved/renumbered by the opf isa wg
+-----01011-,ALU,OP_FISHMV,FRS,CONST_UI,NONE,FRS,NONE,NONE,0,0,ZERO,0,NONE,0,0,0,0,0,0,NONE,0,0,fishmv,DX,,1,unofficial until submitted and approved/renumbered by the opf isa wg
'setvl', 'svindex', 'svremap', 'svstep', 'svshape',
'grev', 'ternlogi', 'bmask', 'cprop',
'absdu', 'absds', 'absdacs', 'absdacu', 'avgadd',
- 'fmvis',
+ 'fmvis', 'fishmv',
]:
illegal = False
ins_name = dotstrp
# main input registers (RT, RA ...)
inputs = []
for name in input_names:
+ print("name", name)
regval = (yield from self.get_input(name))
+ print("regval", regval)
inputs.append(regval)
# arrrrgh, awful hack, to get _RT into namespace
sys.argv = sys.argv[:1]
if not testing:
- testing = ['fmvis']
+ testing = ['fmvis', 'fishmv']
unittest.main(exit=False)
suite = unittest.TestSuite()
"fmr", "fabs", "fnabs", "fneg", "fcpsgn", # FP move/abs/neg
"fsins", "fcoss", # FP SIN/COS
"fmvis", # FP load immediate
+ "fishmv", # Float Replace Lower-Half Single, Immediate
'grev', 'grev.', 'grevi', 'grevi.',
'grevw', 'grevw.', 'grevwi', 'grevwi.',
"hrfid", "icbi", "icbt", "isel", "isync",
OP_BMASK = 94
OP_SVINDEX = 95
OP_FMVIS = 96
+ OP_FISHMV = 97
@unique
# | PO | FRS | d1 | d0 | XO |d2 |
PO = 22
XO = 0b00011
- Rc = 0
(FRS, imm) = fields
# first split imm into d1, d0 and d2. sigh
d2 = (imm & 1) # LSB (0)
)
+def fishmv(fields):
+ # XXX WARNING THESE ARE NOT APPROVED BY OPF ISA WG
+ # V3.0B 1.6.6 DX-FORM
+ # |0 |6 |7|8|9 |10 |11|12|13 |15|16|17 |26|27 |31 |
+ # | PO | FRS | d1 | d0 | XO |d2 |
+ PO = 22
+ XO = 0b01011
+ (FRS, imm) = fields
+ # first split imm into d1, d0 and d2. sigh
+ d2 = (imm & 1) # LSB (0)
+ d1 = (imm >> 1) & 0b11111 # bits 1-5
+ d0 = (imm >> 5) # MSBs 6-15
+ print("imm", hex(imm))
+ print("d0 d1 d2", hex(d0), hex(d1), hex(d2))
+ return instruction(
+ (PO , 0 , 5),
+ (FRS, 6 , 10),
+ (d1, 11, 15),
+ (d0, 16, 26),
+ (XO , 27, 30),
+ (d2 , 31, 31),
+ )
+
+
CUSTOM_INSNS = {}
for (name, hook) in (
("setvl", setvl),
CUSTOM_INSNS["svindex"] = svindex
CUSTOM_INSNS["svremap"] = svremap
CUSTOM_INSNS["fmvis"] = fmvis
+CUSTOM_INSNS["fishmv"] = fishmv
for (name, imm, wide) in (
("grev", False, False),
e = ExpectedState(pc=0xc, # 3 instructions so 3x4=0xc
fp_regs=expected_fprs) # expected results
self.add_case(Program(lst, bigendian), expected=e)
+
+ def case_1_fishmv(self):
+
+ lst = SVP64Asm(["fmvis 3, 0x4049", # 1st half of 3.14159 in FP32 form
+ "fishmv 3, 0x0FD0", # 2nd half of 3.14159 in FP32 form
+ "fmvis 5, 0x3F80", # 1st half of 1.00195 in FP32 form
+ "fishmv 5, 0x4000", # 2nd half of 1.00195 in FP32 form
+ ])
+ lst = list(lst)
+
+ expected_fprs = [0] * 32
+ expected_fprs[3] = 0x400921fa00000000 # 3.14159 in FP64 form
+ expected_fprs[5] = 0x3ff0080000000000 # 1.00195 in FP64 form
+ e = ExpectedState(pc=0x10, fp_regs=expected_fprs)
+ self.add_case(Program(lst, bigendian), expected=e)