VA-Form
-* divrem2du RT,RA,RB,RC
+* divmod2du RT,RA,RB,RC
Pseudo-code:
maddhdu,NORMAL,,1P,EXTRA2,NO,d:RT,s:RA,s:RB,s:RC,RA,RB,RC,RT,0,0,0
madded,NORMAL,,1P,EXTRA2,NO,d:RT,s:RA,s:RB,s:RC,RA,RB,RC,RT,0,0,0
maddld,NORMAL,,1P,EXTRA2,NO,d:RT,s:RA,s:RB,s:RC,RA,RB,RC,RT,0,0,0
-divrem2du,NORMAL,,1P,EXTRA2,NO,d:RT,s:RA,s:RB,s:RC,RA,RB,RC,RT,0,0,0
+divmod2du,NORMAL,,1P,EXTRA2,NO,d:RT,s:RA,s:RB,s:RC,RA,RB,RC,RT,0,0,0
absdacs,NORMAL,,1P,EXTRA2,NO,d:RT;d:CR0,s:RA,s:RB,s:RT,RA,RB,RT,RT,0,CR0,0
absdacu,NORMAL,,1P,EXTRA2,NO,d:RT;d:CR0,s:RA,s:RB,s:RT,RA,RB,RT,RT,0,CR0,0
pcdec,NORMAL,,1P,EXTRA2,NO,d:RT;d:CR0,s:RA,s:RB,s:RC,RA,RB,RC,RT,0,CR0,0
49,ALU,OP_MADDHDU,RA,RB,RC,RT,NONE,NONE,0,0,ZERO,0,NONE,0,0,0,0,1,0,NONE,0,0,maddhdu,VA,,,
50,ALU,OP_MADDED,RA,RB,RC,RT,NONE,NONE,0,0,ZERO,0,NONE,0,0,0,0,1,0,NONE,0,0,madded,VA,,1,unofficial until submitted and approved/renumbered by the opf isa wg
51,ALU,OP_MADDLD,RA,RB,RC,RT,NONE,NONE,0,0,ZERO,0,NONE,0,0,0,0,1,0,NONE,0,0,maddld,VA,,,
-52,ALU,OP_DIVREM2DU,RA,RB,RC,RT,NONE,NONE,0,0,ZERO,0,NONE,0,0,0,0,1,0,NONE,0,0,divrem2du,VA,,1,unofficial until submitted and approved/renumbered by the opf isa wg
+52,ALU,OP_DIVMOD2DU,RA,RB,RC,RT,NONE,NONE,0,0,ZERO,0,NONE,0,0,0,0,1,0,NONE,0,0,divmod2du,VA,,1,unofficial until submitted and approved/renumbered by the opf isa wg
56,ALU,OP_PCDEC,RA,RB,RC,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,1,0,ONE,0,0,pcdec,VA2,,1,unofficial until submitted and approved/renumbered by the opf isa wg
57,ALU,OP_PCDEC,RA,RB,RC,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,1,0,ONE,0,0,pcdec,VA2,,1,unofficial until submitted and approved/renumbered by the opf isa wg
'svshape', 'svshape2',
'grev', 'ternlogi', 'bmask', 'cprop',
'absdu', 'absds', 'absdacs', 'absdacu', 'avgadd',
- 'fmvis', 'fishmv', 'pcdec', "madded", "divrem2du",
+ 'fmvis', 'fishmv', 'pcdec', "madded", "divmod2du",
"dsld", "dsrd",
]:
illegal = False
with m.If((major == 4) & xo6.matches(
'11100-', # pcdec
'110010', # madded
- '110100', # divrem2du
+ '110100', # divmod2du
)):
comb += self.implicit_rs.eq(1)
"dcbf", "dcbst", "dcbt", "dcbtst", "dcbz",
"divd", "divde", "divdeo", "divdeu",
"divdeuo", "divdo", "divdu", "divduo",
- "divrem2du",
+ "divmod2du",
"divw", "divwe", "divweo",
"divweu", "divweuo", "divwo", "divwu", "divwuo",
"dsld", "dsrd",
OP_FISHMV = 97
OP_PCDEC = 98
OP_MADDED = 99
- OP_DIVREM2DU = 100
+ OP_DIVMOD2DU = 100
OP_DSHL = 101
OP_DSHR = 102
@_custom_insns(
_insn("madded", XO=50),
- _insn("divrem2du", XO=52),
+ _insn("divmod2du", XO=52),
)
def va_form(fields, XO):
# XXX WARNING THESE ARE NOT APPROVED BY OPF ISA WG
e.intregs[4] = (gprs[5] * gprs[6] + gprs[7]) >> 64
self.add_case(Program(lst, False), gprs, expected=e)
- def case_divrem2du(self):
- lst = list(SVP64Asm(["divrem2du 3,5,6,7"]))
+ def case_divmod2du(self):
+ lst = list(SVP64Asm(["divmod2du 3,5,6,7"]))
gprs = [0] * 32
gprs[5] = 0x123456789ABCDEF
gprs[6] = 0xFEDCBA9876543210
e.intregs[4] = v % gprs[6]
self.add_case(Program(lst, False), gprs, expected=e)
- # FIXME: test more divrem2du special cases
+ # FIXME: test more divmod2du special cases
def case_dsld0(self):
prog = Program(list(SVP64Asm(["dsld 3,4,5,0"])), False)