Skip to content

Commit 05b6533

Browse files
FanShupeiAvimitin
authored andcommitted
[tests] add asm.zvma
1 parent 09b333b commit 05b6533

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

tests/asm/zvma/zvma.S

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
.text
2+
.balign 16
3+
.globl test
4+
5+
test:
6+
addi sp, sp, -32
7+
sw s0, 0(sp)
8+
sw s1, 4(sp)
9+
sw s2, 8(sp)
10+
sw s3, 12(sp)
11+
sw s4, 16(sp)
12+
sw s5, 20(sp)
13+
sw s6, 24(sp)
14+
sw s7, 28(sp)
15+
j test_1
16+
17+
test_1:
18+
# vtype=0b_11_0_00_000_000, twiden=4, alt=0, sew=8
19+
vsetvli s1, x0, 0x600
20+
21+
# s1 shall be vl=TEW
22+
23+
.insn i OP_V, 7, s2, s1, 0x841 - 0x1000 # settm s2, s1
24+
25+
li t1, 4
26+
.insn i OP_V, 7, s3, t1, 0x842 - 0x1000 # settk s3, t1
27+
28+
# BEGIN : load into matrix
29+
30+
la a1, test_zero
31+
32+
li a0, 0
33+
1:
34+
35+
# a0 is TSS, load to mt0, row major
36+
# NOTE: rs1, rs2 is order swapped
37+
.insn r LOAD_FP, 7, 0x29, x0, a1, a0 # vlte32 a0, a1
38+
39+
addi a0, a0, 1
40+
blt a0, s1, 1b
41+
42+
# END : load into matrix
43+
44+
vid.v v0
45+
vid.v v8
46+
47+
# NOTE: OP_VE=0b1110111 is currently unsupported
48+
.insn r 0x77, 0, 0x79, x0, x0, x8 # mm.u.u mt0, v0, v8
49+
50+
j test_ret
51+
52+
test_ret:
53+
li a0, 4096
54+
9:
55+
addi a0, a0, -1
56+
bgtz a0, 9b
57+
58+
lw s0, 0(sp)
59+
lw s1, 4(sp)
60+
lw s2, 8(sp)
61+
lw s3, 12(sp)
62+
lw s4, 16(sp)
63+
lw s5, 20(sp)
64+
lw s6, 24(sp)
65+
lw s7, 28(sp)
66+
addi sp, sp, 32
67+
ret
68+
69+
70+
71+
.section .vbss, "aw", @nobits
72+
.balign 64
73+
test_zero:
74+
.zero 65536

0 commit comments

Comments
 (0)