def test_svremap(self):
"""svremap, see if values get set
"""
- lst = SVP64Asm(["svremap 11, 0, 1, 2, 3, 3",
+ lst = SVP64Asm(["svremap 11, 0, 1, 2, 3, 3, 1",
])
lst = list(lst)
with Program(lst, bigendian=False) as program:
sim = self.run_tst_program(program)
- svremap = sim.svstate
- print ("SVREMAP after", bin(svremap.value))
- print (" men", bin(svremap.SVme))
- print (" mi0", bin(svremap.mi0))
- print (" mi1", bin(svremap.mi1))
- print (" mi2", bin(svremap.mi2))
- print (" mo0", bin(svremap.mo0))
- print (" mo1", bin(svremap.mo1))
- self.assertEqual(svremap.SVme, 11)
- self.assertEqual(svremap.mi0, 0)
- self.assertEqual(svremap.mi1, 1)
- self.assertEqual(svremap.mi2, 2)
- self.assertEqual(svremap.mo0, 3)
- self.assertEqual(svremap.mo1, 3)
+ svstate = sim.svstate
+ print ("SVREMAP after", bin(svstate.value))
+ print (" men", bin(svstate.SVme))
+ print (" mi0", bin(svstate.mi0))
+ print (" mi1", bin(svstate.mi1))
+ print (" mi2", bin(svstate.mi2))
+ print (" mo0", bin(svstate.mo0))
+ print (" mo1", bin(svstate.mo1))
+ print (" persist", bin(svstate.RMpst))
+ self.assertEqual(svstate.SVme, 11)
+ self.assertEqual(svstate.mi0, 0)
+ self.assertEqual(svstate.mi1, 1)
+ self.assertEqual(svstate.mi2, 2)
+ self.assertEqual(svstate.mo0, 3)
+ self.assertEqual(svstate.mo1, 3)
+ self.assertEqual(svstate.RMpst, 1)
def run_tst_program(self, prog, initial_regs=None,
svstate=None):
def test_sv_remap_fpmadds_fft(self):
""">>> lst = ["svshape 8, 1, 1, 1, 0",
- "svremap 31, 1, 0, 2, 0, 1",
+ "svremap 31, 1, 0, 2, 0, 1, 0",
"sv.ffmadds 2.v, 2.v, 2.v, 10.v"
]
runs a full in-place O(N log2 N) butterfly schedule for
(3 inputs, 2 outputs)
"""
lst = SVP64Asm( ["svshape 8, 1, 1, 1, 0",
- "svremap 31, 1, 0, 2, 0, 1",
+ "svremap 31, 1, 0, 2, 0, 1, 0",
"sv.ffmadds 0.v, 0.v, 0.v, 8.v"
])
lst = list(lst)
def test_sv_remap_fpmadds_fft_svstep(self):
""">>> lst = SVP64Asm( [
"svshape 8, 1, 1, 1, 1",
- "svremap 31, 1, 0, 2, 0, 1",
+ "svremap 31, 1, 0, 2, 0, 1, 0",
"sv.ffmadds 0.v, 0.v, 0.v, 8.v",
"setvl. 0, 0, 1, 1, 0, 0",
"bc 4, 2, -16"
"""
lst = SVP64Asm( [
"svshape 8, 1, 1, 1, 1",
- "svremap 31, 1, 0, 2, 0, 1",
+ "svremap 31, 1, 0, 2, 0, 1, 0",
"sv.ffmadds 0.v, 0.v, 0.v, 8.v",
"setvl. 0, 0, 1, 1, 0, 0",
"bc 4, 2, -16"
""">>> lst = SVP64Asm( [
"svshape 8, 1, 1, 1, 1",
# RA: jh (S1) RB: n/a RC: k (S2) RT: scalar EA: n/a
- "svremap 5, 1, 0, 2, 0, 0",
+ "svremap 5, 1, 0, 2, 0, 0, 1",
"sv.fmuls 24, 0.v, 8.v",
# RA: scal RB: jl (S0) RC: n/a RT: jl (S0) EA: jh (S1)
- "svremap 26, 0, 0, 0, 0, 1",
+ "svremap 26, 0, 0, 0, 0, 1, 1",
"sv.ffadds 0.v, 24, 0.v",
"setvl. 0, 0, 1, 1, 0, 0",
"bc 4, 2, -28"
lst = SVP64Asm( [
"svshape 8, 1, 1, 1, 1",
# RA: jh (S1) RB: n/a RC: k (S2) RT: scalar EA: n/a
- "svremap 5, 1, 0, 2, 0, 0",
+ "svremap 5, 1, 0, 2, 0, 0, 1",
"sv.fmuls 24, 0.v, 8.v",
# RA: scal RB: jl (S0) RC: n/a RT: jl (S0) EA: jh (S1)
- "svremap 26, 0, 0, 0, 0, 1",
+ "svremap 26, 0, 0, 0, 0, 1, 1",
"sv.ffadds 0.v, 24, 0.v",
"setvl. 0, 0, 1, 1, 0, 0",
"bc 4, 2, -28"
# set triple butterfly mode
"svshape 8, 1, 1, 1, 1",
# tpre
- "svremap 5, 1, 0, 2, 0, 0",
+ "svremap 5, 1, 0, 2, 0, 0, 1",
"sv.fmuls 24, 0.v, 16.v", # mul1_r = r*cos_r
- "svremap 5, 1, 0, 2, 0, 0",
+ "svremap 5, 1, 0, 2, 0, 0, 1",
"sv.fmadds 24, 8.v, 20.v, 24", # mul2_r = i*sin_i
# tpre = mul1_r + mul2_r
# tpim
- "svremap 5, 1, 0, 2, 0, 0",
+ "svremap 5, 1, 0, 2, 0, 0, 1",
"sv.fmuls 26, 0.v, 20.v", # mul1_i = r*sin_i
- "svremap 5, 1, 0, 2, 0, 0",
+ "svremap 5, 1, 0, 2, 0, 0, 1",
"sv.fmsubs 26, 8.v, 16.v, 26", # mul2_i = i*cos_r
# tpim = mul2_i - mul1_i
# vec_r jh/jl
- "svremap 26, 0, 0, 0, 0, 1",
+ "svremap 26, 0, 0, 0, 0, 1, 1",
"sv.ffadds 0.v, 24, 0.v", # vh/vl +/- tpre
# vec_i jh/jl
- "svremap 26, 0, 0, 0, 0, 1",
+ "svremap 26, 0, 0, 0, 0, 1, 1",
"sv.ffadds 8.v, 26, 8.v", # vh/vl +- tpim
# svstep loop
def test_sv_remap1(self):
""">>> lst = ["svshape 2, 2, 3, 0, 0",
- "svremap 31, 1, 2, 3, 0, 0",
+ "svremap 31, 1, 2, 3, 0, 0, 0",
"sv.fmadds 0.v, 8.v, 16.v, 0.v"
]
REMAP fmadds FRT, FRA, FRC, FRB
"""
lst = SVP64Asm(["svshape 2, 2, 3, 0, 0",
- "svremap 31, 1, 2, 3, 0, 0",
+ "svremap 31, 1, 2, 3, 0, 0, 0",
"sv.fmadds 0.v, 16.v, 32.v, 0.v"
])
lst = list(lst)
def test_sv_remap2(self):
""">>> lst = ["svshape 5, 4, 3, 0, 0",
- "svremap 31, 1, 2, 3, 0, 0",
+ "svremap 31, 1, 2, 3, 0, 0, 0, 0",
"sv.fmadds 0.v, 8.v, 16.v, 0.v"
]
REMAP fmadds FRT, FRA, FRC, FRB
"""
lst = SVP64Asm(["svshape 4, 3, 3, 0, 0",
- "svremap 31, 1, 2, 3, 0, 0",
+ "svremap 31, 1, 2, 3, 0, 0, 0, 0",
"sv.fmadds 0.v, 16.v, 32.v, 0.v"
])
lst = list(lst)