None
+# Load Floating-Point Immediate
+
+X-Form
+
+* fmvis FRS,FRS,SI
+
+Pseudo-code:
+
+ FRS <- EXTS(SI)
+
+Special Registers Altered:
+
+ None
xori,NORMAL,,2P,EXTRA3,d:RA,s:RS,0,0,RS,0,0,RA,0,0,0
xoris,NORMAL,,2P,EXTRA3,d:RA,s:RS,0,0,RS,0,0,RA,0,0,0
subfic,NORMAL,,2P,EXTRA3,d:RT,s:RA,0,0,RA,0,0,RT,0,0,0
+fmvis,NORMAL,,2P,EXTRA3,TODO,0,0,0,FRS,0,0,FRS,0,0,0
cntlzw,NORMAL,,2P,EXTRA3,d:RA;d:CR0,s:RS,0,0,RS,0,0,RA,0,CR0,0
cntlzd,NORMAL,,2P,EXTRA3,d:RA;d:CR0,s:RS,0,0,RS,0,0,RA,0,CR0,0
subfze,NORMAL,,2P,EXTRA3,d:RT;d:CR0,s:RA,0,0,RA,0,0,RT,0,CR0,0
# Vector bitmanip
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,FRS,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
'setvl', 'svindex', 'svremap', 'svstep', 'svshape',
'grev', 'ternlogi', 'bmask', 'cprop',
'absdu', 'absds', 'absdacs', 'absdacu', 'avgadd',
+ 'fmvis',
]:
illegal = False
ins_name = dotstrp
--- /dev/null
+""" Decoder tests
+
+related bugs:
+
+ *
+"""
+
+import unittest
+import sys
+
+# These tests utilize the run_hdl=False parameter to compare
+# simulator with expected states
+from soc.simple.test.test_runner import TestRunner
+from openpower.test.alu.fmvis_cases import FMVISTestCase
+
+
+if __name__ == "__main__":
+
+ # allow list of testing to be selected by command-line
+ testing = sys.argv[1:]
+ sys.argv = sys.argv[:1]
+
+ if not testing:
+ testing = ['fmvis']
+
+ unittest.main(exit=False)
+ suite = unittest.TestSuite()
+
+ # dictionary of data for tests
+ tests = {'fmvis': FMVISTestCase().test_data}
+
+ # walk through all tests, those requested get added
+ for tname, data in tests.items():
+ if tname in testing:
+ suite.addTest(TestRunner(data, run_hdl=False))
+
+ runner = unittest.TextTestRunner()
+ runner.run(suite)
"fmul", "fmuls", "fdiv", "fdivs", # FP mul / div
"fmr", "fabs", "fnabs", "fneg", "fcpsgn", # FP move/abs/neg
"fsins", "fcoss", # FP SIN/COS
+ "fmvis", # FP load immediate
'grev', 'grev.', 'grevi', 'grevi.',
'grevw', 'grevw.', 'grevwi', 'grevwi.',
"hrfid", "icbi", "icbt", "isel", "isync",
OP_CPROP = 93
OP_BMASK = 94
OP_SVINDEX = 95
+ OP_FMVIS = 96
@unique
)
+def fmvis(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 = 0b000011
+ (FRS, d0, d1, d2) = fields
+ return instruction(
+ (PO , 0 , 5),
+ (FRS, 6 , 10),
+ (d0 , 11, 15),
+ (d1 , 16, 26),
+ (XO , 27, 30),
+ (d2 , 31, 31),
+ )
+
+
CUSTOM_INSNS = {}
for (name, hook) in (
("setvl", setvl),
("fsins", fsins),
("fcoss", fcoss),
("ternlogi", ternlogi),
+ ("fmvis", fmvis)
):
CUSTOM_INSNS[name] = functools.partial(hook, Rc=False)
CUSTOM_INSNS[f"{name}."] = functools.partial(hook, Rc=True)
("absdacu", 0b1111110110),
("absdacs", 0b0111110110),
("cprop" , 0b0110001110),
+ ("fmvis" , 0b0000000011),
):
CUSTOM_INSNS[name] = functools.partial(av, XO=XO, Rc=False)
CUSTOM_INSNS[f"{name}."] = functools.partial(av, XO=XO, Rc=True)
insn |= 1 << (31-31) # Rc=1 , bit 31
log("fcoss", bin(insn))
yield ".long 0x%x" % insn
-
else:
yield "%s %s" % (v30b_op+rc, ", ".join(v30b_newfields))
log("new v3.0B fields", v30b_op, v30b_newfields)
--- /dev/null
+from openpower.sv.trans.svp64 import SVP64Asm
+import random
+from openpower.test.common import TestAccumulatorBase
+from openpower.endian import bigendian
+from openpower.simulator.program import Program
+from openpower.decoder.selectable_int import SelectableInt
+from openpower.decoder.power_enums import XER_bits
+from openpower.decoder.isa.caller import special_sprs
+from openpower.decoder.helpers import exts
+from openpower.test.state import ExpectedState
+import unittest
+
+class FMVISTestCase(TestAccumulatorBase):
+
+ def case_0_fmvis(self):
+ lst = SVP64Asm(["fmvis 5, 5, 0x4000",
+ "fmvis 6, 6, 0x2122",
+ "fmvis 7, 7, 0x3E80",
+ ])
+ lst = list(lst)
+
+ expected_fprs = [0] * 32
+ expected_fprs[5] = 0x40000000
+ expected_fprs[6] = 0x21220000
+ expected_fprs[7] = 0x3E800000
+ self.add_case(Program(lst, bigendian), expected_fprs)