X-Form
-* absaddu RT,RA,RB (Rc=0)
-* absaddu. RT,RA,RB (Rc=1)
+* absdacu RT,RA,RB (Rc=0)
+* absdacu. RT,RA,RB (Rc=1)
Pseudo-code:
X-Form
-* absadds RT,RA,RB (Rc=0)
-* absadds. RT,RA,RB (Rc=1)
+* absdacs RT,RA,RB (Rc=0)
+* absdacs. RT,RA,RB (Rc=1)
Pseudo-code:
0001001110-,ALU,OP_MINMAX,RA,RB,NONE,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,0,0,RC,0,0,minu,X,,1,unofficial until submitted and approved/renumbered by the opf isa wg
1101001110-,ALU,OP_AVGADD,RA,RB,NONE,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,0,0,RC,0,0,avgadd,X,,1,unofficial until submitted and approved/renumbered by the opf isa wg
1011110110-,ALU,OP_ABSDIFF,RA,RB,NONE,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,0,0,RC,0,0,absdu,X,,1,unofficial until submitted and approved/renumbered by the opf isa wg
-1111110110-,ALU,OP_ABSADD,RA,RB,RT,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,0,0,RC,0,0,absaddu,X,,1,unofficial until submitted and approved/renumbered by the opf isa wg
-0111110110-,ALU,OP_ABSADD,RA,RB,RT,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,0,0,RC,0,0,absadds,X,,1,unofficial until submitted and approved/renumbered by the opf isa wg
+1111110110-,ALU,OP_ABSADD,RA,RB,RT,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,0,0,RC,0,0,absdacu,X,,1,unofficial until submitted and approved/renumbered by the opf isa wg
+0111110110-,ALU,OP_ABSADD,RA,RB,RT,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,0,0,RC,0,0,absdacs,X,,1,unofficial until submitted and approved/renumbered by the opf isa wg
ins_name = asmop
# and anything absadd
- if asmop.startswith('absadd'):
+ if asmop.startswith('absdac'):
illegal = False
ins_name = asmop
"and", "andc", "andi.", "andis.",
"attn",
"absdu", # AV bitmanip
- "absaddu", "absadds", # AV bitmanip
+ "absdacs", "absdacu", # AV bitmanip
"avgadd", # AV bitmanip
"b", "bc", "bcctr", "bclr", "bctar",
"bpermd",
yield ".long 0x%x" % insn
return
- # and avgadd, absdu, absaddu, absadds
+ # and avgadd, absdu, absdacu, absdacs
# XXX WARNING THESE ARE NOT APPROVED BY OPF ISA WG
- if opcode in ['avgadd', 'absdu', 'absaddu', 'absadds']:
+ if opcode in ['avgadd', 'absdu', 'absdacu', 'absdacs']:
if opcode[:5] == 'absdu':
XO = 0b1011110110
elif opcode[:6] == 'avgadd':
XO = 0b1101001110
- elif opcode[:7] == 'absaddu':
+ elif opcode[:7] == 'absdacu':
XO = 0b1111110110
- elif opcode[:7] == 'absadds':
+ elif opcode[:7] == 'absdacs':
XO = 0b0111110110
fields = list(map(int, fields))
insn = 22 << (31-5) # opcode 22, bits 0-5
'maxs. 3,12,5',
'avgadd 3,12,5',
'absdu 3,12,5',
- 'absaddu 3,12,5',
- 'absadds 3,12,5',
+ 'absdacu 3,12,5',
+ 'absdacs 3,12,5',
]
isa = SVP64Asm(lst, macros=macros)
log("list", list(isa))
e.intregs[3] = 0x3
self.add_case(Program(lst, bigendian), initial_regs, expected=e)
- def case_0_absaddu(self):
- lst = ["absaddu 3, 1, 2",
- "absaddu 3, 4, 5",
+ def case_0_absdacu(self):
+ lst = ["absdacu 3, 1, 2",
+ "absdacu 3, 4, 5",
]
lst = list(SVP64Asm(lst, bigendian))
e.intregs[5] = 0x3
self.add_case(Program(lst, bigendian), initial_regs, expected=e)
- def case_1_absaddu(self):
- lst = ["absaddu 3, 1, 2",
- "absaddu 3, 4, 5",
+ def case_1_absdacu(self):
+ lst = ["absdacu 3, 1, 2",
+ "absdacu 3, 4, 5",
]
lst = list(SVP64Asm(lst, bigendian))
e.intregs[5] = 0x3
self.add_case(Program(lst, bigendian), initial_regs, expected=e)
- def case_2_absaddu(self):
+ def case_2_absdacu(self):
"""weird case where there's a negative number
* -1 is greater than 2 (as an unsigned number)
therefore difference is (-1)-(2) which is -3
=3
* answer: RT=3
"""
- lst = ["absaddu 3, 1, 2",
- "absaddu 3, 4, 5",
+ lst = ["absdacu 3, 1, 2",
+ "absdacu 3, 4, 5",
]
lst = list(SVP64Asm(lst, bigendian))
e.intregs[5] = 0x3
self.add_case(Program(lst, bigendian), initial_regs, expected=e)
- def case_0_absadds(self):
- lst = ["absadds 3, 1, 2",
- "absadds 3, 4, 5",
+ def case_0_absdacs(self):
+ lst = ["absdacs 3, 1, 2",
+ "absdacs 3, 4, 5",
]
lst = list(SVP64Asm(lst, bigendian))
e.intregs[5] = 0x3
self.add_case(Program(lst, bigendian), initial_regs, expected=e)
- def case_2_absadds(self):
- """unlike the absaddu weird case, the 0xfff is treated as signed
+ def case_2_absdacs(self):
+ """unlike the absdacu weird case, the 0xfff is treated as signed
so (2) < (-1) and the difference is (2--1)=3. next instruction
adds 6 more. answer: 9
"""
- lst = ["absadds 3, 1, 2",
- "absadds 3, 4, 5",
+ lst = ["absdacs 3, 1, 2",
+ "absdacs 3, 4, 5",
]
lst = list(SVP64Asm(lst, bigendian))