TLI-Form
-* ternlogi RT, RA, RB, TLI (Rc=0)
-* ternlogi. RT, RA, RB, TLI (Rc=1)
+* ternlogi RT, RA, RB, TLI
Pseudo-code:
Special Registers Altered:
- CR0 (if Rc=1)
+ None
| PO | SVme |mi0 | mi1 | mi2 | mo0 | mo1 |pst |/// | XO | / |
# 1.6.34 TLI-FORM
- |0 |6 |11 |16 |21 |29 |31 |
- | PO | RT | RA | RB | TLI | XO |Rc |
+ |0 |6 |11 |16 |21 |29 |
+ | PO | RT | RA | RB | TLI | XO |
# 1.6.28 Instruction Fields
A (6)
XO (27:30)
Extended opcode field.
Formats: MDS
- XO (29:30)
- Extended opcode field.
- Formats: TLI
XO (29:31)
Extended opcode field.
- Formats: DQ
+ Formats: DQ, TLI
XO (30)
Extended opcode field.
Formats: SC
opcode,unit,internal op,in1,in2,in3,out,CR in,CR out,inv A,inv out,cry in,cry out,ldst len,BR,sgn ext,upd,rsrv,32b,sgn,rc,lk,sgl pipe,comment,form,CONDITIONS,unofficial,comment2
---------00-,SHIFT_ROT,OP_TERNLOG,RA,RB,RT,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,0,0,RC,0,0,ternlogi,TLI,,1,unofficial until submitted and approved/renumbered by the opf isa wg
+--------00-,SHIFT_ROT,OP_TERNLOG,RA,RB,RT,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,0,0,NONE,0,0,ternlogi,TLI,,1,unofficial until submitted and approved/renumbered by the opf isa wg
illegal = False
ins_name = 'ffadds'
- if asmop == 'ternlogi' or asmop == 'ternlogi.':
+ if asmop == 'ternlogi':
illegal = False
ins_name = asmop
class BitManipTestCase(TestAccumulatorBase):
- def do_case_ternlogi(self, rt_v, ra_v, rb_v, imm, rc):
+ def do_case_ternlogi(self, rt_v, ra_v, rb_v, imm):
po = 5
xo = 0
rt = 3
instr = (instr << 5) | ra
instr = (instr << 5) | rb
instr = (instr << 8) | imm
- instr = (instr << 2) | xo
- instr = (instr << 1) | rc
- asm = f"ternlogi{'.' * rc} {rt}, {ra}, {rb}, {imm}"
+ instr = (instr << 3) | xo
+ asm = f"ternlogi {rt}, {ra}, {rb}, {imm}"
lst = [f".4byte {hex(instr)} # {asm}"]
initial_regs = [0] * 32
initial_regs[3] = rt_v % 2 ** 64
def case_ternlogi_0(self):
self.do_case_ternlogi(0x8000_0000_FFFF_0000,
0x8000_0000_FF00_FF00,
- 0x8000_0000_F0F0_F0F0, 0x80, rc=1)
+ 0x8000_0000_F0F0_F0F0, 0x80)
def case_ternlogi_FF(self):
- self.do_case_ternlogi(0, 0, 0, 0xFF, rc=1)
+ self.do_case_ternlogi(0, 0, 0, 0xFF)
- @skip_case
def case_ternlogi_random(self):
for i in range(100):
imm = hash_256(f"ternlogi imm {i}") & 0xFF
rt_v = hash_256(f"ternlogi rt {i}") % 2 ** 64
ra_v = hash_256(f"ternlogi ra {i}") % 2 ** 64
rb_v = hash_256(f"ternlogi rb {i}") % 2 ** 64
- self.do_case_ternlogi(rt_v, ra_v, rb_v, imm, rc=1)
+ self.do_case_ternlogi(rt_v, ra_v, rb_v, imm)