SVL-Form
-* setvl RT, RA, SVi, vs, ms
-* setvl. RT, RA, SVi, vs, ms
+* setvl RT, RA, SVi, vf, vs, ms
+* setvl. RT, RA, SVi, vf, vs, ms
Pseudo-code:
- VLimm <- SVi + 1
- if vs = 1 then
- if _RA != 0 then
- VL <- (RA|0)[57:63]
- else
- VL <- VLimm[1:7]
- else
- VL <- SVSTATE[7:13]
- if ms = 1 then
- MVL <- VLimm[1:7]
+ if (vf & (¬vs) & ¬(ms)) = 1 then
+ SVSTATE_NEXT(vf)
else
- MVL <- SVSTATE[0:6]
- if VL > MVL then
- VL = MVL
- SVSTATE[0:6] <- MVL
- SVSTATE[7:13] <- VL
- RT <- [0]*57 || VL
+ VLimm <- SVi + 1
+ if vs = 1 then
+ if _RA != 0 then
+ VL <- (RA|0)[57:63]
+ else
+ VL <- VLimm[0:6]
+ else
+ VL <- SVSTATE[7:13]
+ if ms = 1 then
+ MVL <- VLimm[0:6]
+ else
+ MVL <- SVSTATE[0:6]
+ if VL > MVL then
+ VL = MVL
+ SVSTATE[0:6] <- MVL
+ SVSTATE[7:13] <- VL
+ RT <- [0]*57 || VL
+ MSR[6] <- vf
Special Registers Altered:
| PO | RT| d1| d0| XO|d2
# 1.6.28 SVL-FORM
- |0 |6 |11 |16 |22 |24 |25 |26 |31 |
- | PO | RT | RA | SVi |// |vs |ms | XO |Rc |
+ |0 |6 |11 |16 |23 |24 |25 |26 |31 |
+ | PO | RT | RA | SVi |vf |vs |ms | XO |Rc |
# 1.6.29 SVC-FORM
|0 |6 |9 |11 |
two's complement integer which is concatenated
on the right with 0b00 and sign-extended to 64 bits.
Formats: SVDS
- SVi (16:23)
+ SVi (16:22)
Simple-V immediate field for setting VL or MVL
Formats: SVL
SVRM (21:25)
VRT (6:10)
Field used to specify a VR to be used as a target.
Formats: DS, VA, VC, VX, X
+ vf (23)
+ Field used in Simple-V to specify whether "Vertical" Mode is set
+ Formats: SVL
vs (24)
Field used in Simple-V to specify whether VL is to be set
Formats: SVL
SF = 0 # Sixty-Four bit mode
HV = 3 # Hypervisor state
UND = 5 # Undefined behavior state (see Bk 2, Sect. 3.2.1)
+ SVF = 6 # SVP64 "Vertical First" mode
TSs = 29 # Transactional State (subfield)
TSe = 30 # Transactional State (subfield)
TM = 31 # Transactional Memory Available
self.assertEqual(sim.gpr(i), SelectableInt(expected[i], 64))
def test_setvl_1(self):
- lst = SVP64Asm(["setvl 1, 0, 9, 1, 1",
+ lst = SVP64Asm(["setvl 1, 0, 9, 0, 1, 1",
])
lst = list(lst)
# sets VL=2 then adds:
# 1 = 5 + 9 => 0x5555 = 0x4321+0x1234
# 2 = 6 + 10 => 0x3334 = 0x2223+0x1111
- isa = SVP64Asm(["setvl 3, 0, 1, 1, 1",
+ isa = SVP64Asm(["setvl 3, 0, 1, 0, 1, 1",
'sv.add 1.v, 5.v, 9.v'
])
lst = list(isa)
fields = list(map(int, fields))
insn |= fields[0] << (31-10) # RT , bits 6-10
insn |= fields[1] << (31-15) # RA , bits 11-15
- insn |= fields[2] << (31-23) # SVi , bits 16-23
- insn |= fields[3] << (31-24) # vs , bit 24
- insn |= fields[4] << (31-25) # ms , bit 25
+ insn |= fields[2] << (31-22) # SVi , bits 16-22
+ insn |= fields[3] << (31-23) # vf , bit 23
+ insn |= fields[4] << (31-24) # vs , bit 24
+ insn |= fields[5] << (31-25) # ms , bit 25
insn |= 0b00000 << (31-30) # XO , bits 26..30
if opcode == 'setvl.':
insn |= 1 << (31-31) # Rc=1 , bit 31
lst += [
'sv.stw 5.v, 4(1.v)',
'sv.ld 5.v, 4(1.v)',
- 'setvl. 2, 3, 4, 1, 1',
+ 'setvl. 2, 3, 4, 0, 1, 1',
]
lst = [
"sv.stfsu 0.v, 16(4.v)",