SVM2-Form
-* svshape2 offs,yx,rmm,SVd,sk,mm
+* svshape2 offs,inv,yx,rmm,SVd,sk,mm
Pseudo-code:
shape[18:20] <- 0b000 # ordering xd/yd(/zd)
if sk = 0 then shape[6:11] <- 0 # ydim
else shape[6:11] <- 0b111111 # ydim max
+ shape[21:23] <- (0b00 || inv) # "inverse" on xdim
else
shape[18:20] <- 0b010 # ordering yd/xd(/zd)
if sk = 1 then shape[6:11] <- 0 # ydim
else shape[6:11] <- d-1 # ydim max
+ shape[21:23] <- (0b0 || inv || 0b0) # "inverse" ydim
# offset (the prime purpose of this instruction)
- shape[24:27] <- offs # offset
+ shape[24:27] <- (0b0 || offs) # offset extended 1-bit
if sk = 1 then shape[28:29] <- 0b01 # skip 1st dimension
else shape[28:29] <- 0b00 # no skipping
# select the mode for updating SVSHAPEs
| PO | SVxd | SVyd | SVzd | SVrm |vf | XO |
# 1.6.35.1 SVM2-FORM
- |0 |6 |10|11 |16 |21 |24|25 |26 |31 |
- | PO | offs |yx| rmm | SVd |XO |mm|sk | XO |
+ |0 |6 |9 |10|11 |16 |21 |24|25 |26 |31 |
+ | PO |offs|inv|yx| rmm | SVd |XO |mm|sk | XO |
# 1.6.36 SVRM-FORM
|0 |6 |11 |13 |15 |17 |19 |21 |22 |26 |31 |
IMM8 (13:20)
Immediate field used to specify an 8-bit integer.
Formats: X
+ inv (9)
+ Field used by the svshape2 instruction for inversion of one dimension
+ Formats: SVM2
IS (6:10)
Immediate field used to specify a 5-bit signed inte-
ger.
Field used to specify the number of bytes to move
in an immediate Move Assist instruction.
Formats: X
- offs (6:9)
+ offs (6:8)
Field used by the svshape2 instruction as an offset
Formats: SVM2
OC (6:20)
def test_0_sv_shape2(self):
"""sets VL=10 (via SVSTATE) then does svshape mm=0, checks SPRs after
"""
- isa = SVP64Asm(['svshape2 12, 1, 15, 5, 0, 0'
+ isa = SVP64Asm(['svshape2 6, 1, 1, 15, 5, 0, 0'
])
lst = list(isa)
print("listing", lst)
self.assertEqual(SVSHAPE0.xdimsz, 5) # set
self.assertEqual(SVSHAPE0.ydimsz, 2) # calculated from MVL/xdimsz
self.assertEqual(SVSHAPE0.skip, 0) # no skip
- # (no inversion possible)
- self.assertEqual(SVSHAPE0.invxyz, [0, 0, 0])
- self.assertEqual(SVSHAPE0.offset, 12)
+ # invert y rather than x because yx=1
+ self.assertEqual(SVSHAPE0.invxyz, [0, 1, 0])
+ self.assertEqual(SVSHAPE0.offset, 6)
self.assertEqual(SVSHAPE0.order, (1, 0, 2)) # y,x(,z)
self.assertEqual(sim.svstate.RMpst, 0) # mm=0 so persist=0
self.assertEqual(sim.svstate.SVme, 0b01111) # same as rmm
https://libre-soc.org/openpower/sv/remap/discussion
- * svshape2 offs,yx,rmm,SVd,sk,mm
+ * svshape2 offs,inv,yx,rmm,SVd,sk,mm
# 1.6.35.1 SVM2-FORM from fields.txt
- # |0 |6 |10|11 |16 |21 |24|25 |26 |31 |
- # | PO | offs |yx| rmm | SVd |XO |mm|sk | XO |
+ # |0 |6 |9 |10|11 |16 |21 |24|25 |26 |31 |
+ # | PO |offs|inv|yx| rmm | SVd |XO |mm|sk | XO |
note that this fits into the space of svshape and that XO is
split across 2 areas.
PO = 22
XO = 0b011001
XO2 = 0b100 # not really XO2 but hey
- (offs, yx, rmm, SVd, sk, mm) = fields
+ (offs, inv, yx, rmm, SVd, sk, mm) = fields
SVd -= 1 # offset by one
return instruction(
(PO, 0, 5),
- (offs, 6, 9), # offset (the whole point of adding svshape2)
+ (offs, 6, 8), # offset (the whole point of adding svshape2)
+ (inv, 9, 9), # invert one dimension (depends on yx)
(yx, 10, 10), # like svindex
(rmm, 11, 15), # ditto svindex
(SVd, 16, 20), # ditto svindex