Automatic date update in version.in
[binutils-gdb.git] / sim / testsuite / mips / r6.s
blobd30ffffe13772dbafff8b8409c0a6e5c39322f94
1 # mips r6 tests (non FPU)
2 # mach: mips32r6 mips64r6
3 # as: -mabi=eabi
4 # ld: -N -Ttext=0x80010000
5 # output: *\\npass\\n
7 .include "testutils.inc"
8 .include "utils-r6.inc"
10 setup
12 .data
13 dval1: .word 0xabcd1234
14 dval2: .word 0x1234eeff
15 .fill 248,1,0
16 dval3: .word 0x55555555
17 .fill 260,1,0
18 dval4: .word 0xaaaaaaaa
19 .text
21 .set noreorder
23 .ent DIAG
24 DIAG:
26 writemsg "[1] Test MUL"
27 r6ck_2r mul, 7, 9, 63
28 r6ck_2r mul, -7, -9, 63
29 r6ck_2r mul, 61, -11, -671
30 r6ck_2r mul, 1001, 1234, 1235234
31 r6ck_2r mul, 123456789, 999999, 0x7eb1e22b
32 r6ck_2r mul, 0xaaaabbbb, 0xccccdddd, 0x56787f6f
34 writemsg "[2] Test MUH"
35 r6ck_2r muh, 61, -11, 0xffffffff
36 r6ck_2r muh, 1001, 1234, 0
37 r6ck_2r muh, 123456789, 999999, 0x7048
38 r6ck_2r muh, 0xaaaabbbb, 0xccccdddd, 0x111107f7
40 writemsg "[3] Test MULU"
41 r6ck_2r mulu, 7, 9, 63
42 r6ck_2r mulu, -7, -9, 63
43 r6ck_2r mulu, 61, -11, -671
44 r6ck_2r mulu, 1001, 1234, 1235234
45 r6ck_2r mulu, 123456789, 999999, 0x7eb1e22b
46 r6ck_2r mulu, 0xaaaabbbb, 0xccccdddd, 0x56787f6f
48 writemsg "[4] Test MUHU"
49 r6ck_2r muhu, 1001, 1234, 0
50 r6ck_2r muhu, 123456789, 999999, 0x7048
51 r6ck_2r muhu, 0xaaaabbbb, 0xccccdddd, 0x8888a18f
52 r6ck_2r muhu, 0xaaaabbbb, 0xccccdddd, 0x8888a18f
54 writemsg "[5] Test DIV"
55 r6ck_2r div, 10001, 10, 1000
56 r6ck_2r div, -123456, 560, -220
57 r6ck_2r div, 9, 100, 0
59 writemsg "[6] Test MOD"
60 r6ck_2r mod, 10001, 10, 1
61 r6ck_2r mod, -123456, 560, 0xffffff00
62 r6ck_2r mod, 9, 100, 9
64 writemsg "[7] Test DIVU"
65 r6ck_2r divu, 10001, 10, 1000
66 r6ck_2r divu, -123456, 560, 0x750674
67 r6ck_2r divu, 9, 100, 0
68 r6ck_2r divu, 0xaaaabbbb, 3, 0x38e393e9
70 writemsg "[8] Test MODU"
71 r6ck_2r modu, 10001, 10, 1
72 r6ck_2r modu, -123456, 560, 0
73 r6ck_2r modu, 9, 100, 9
74 r6ck_2r modu, 0xaaaabbbb, 5, 4
76 writemsg "[9] Test LSA"
77 r6ck_2r1i lsa, 1, 2, 2, 6
78 r6ck_2r1i lsa, 0x8000, 0xa000, 1, 0x1a000
79 r6ck_2r1i lsa, 0x82, 0x2000068, 4, 0x2000888
81 writemsg "[10] Test AUI"
82 r6ck_1r1i aui, 0x0000c0de, 0xdead, 0xdeadc0de
83 r6ck_1r1i aui, 0x00005678, 0x1234, 0x12345678
84 r6ck_1r1i aui, 0x0000eeff, 0xabab, 0xababeeff
86 writemsg "[11] Test SELEQZ"
87 r6ck_2r seleqz, 0x1234, 0, 0x1234
88 r6ck_2r seleqz, 0x1234, 4, 0
89 r6ck_2r seleqz, 0x80010001, 0, 0x80010001
91 writemsg "[12] Test SELNEZ"
92 r6ck_2r selnez, 0x1234, 0, 0
93 r6ck_2r selnez, 0x1234, 1, 0x1234
94 r6ck_2r selnez, 0x80010001, 0xffffffff, 0x80010001
96 writemsg "[13] Test ALIGN"
97 r6ck_2r1i align, 0xaabbccdd, 0xeeff0011, 1, 0xff0011aa
98 r6ck_2r1i align, 0xaabbccdd, 0xeeff0011, 3, 0x11aabbcc
100 writemsg "[14] Test BITSWAP"
101 r6ck_1r bitswap, 0xaabbccdd, 0x55dd33bb
102 r6ck_1r bitswap, 0x11884422, 0x88112244
104 writemsg "[15] Test CLZ"
105 r6ck_1r clz, 0x00012340, 15
106 r6ck_1r clz, 0x80012340, 0
107 r6ck_1r clz, 0x40012340, 1
109 writemsg "[16] Test CLO"
110 r6ck_1r clo, 0x00123050, 0
111 r6ck_1r clo, 0xff123050, 8
112 r6ck_1r clo, 0x8f123050, 1
114 writemsg "[17] Test ADDIUPC"
115 jal GetPC
117 addiu $4, $6, 8
118 addiupc $5, 4
119 fp_assert $4, $5
121 writemsg "[18] Test AUIPC"
122 jal GetPC
124 addiu $4, $6, 8
125 aui $4, $4, 8
126 auipc $5, 8
127 fp_assert $4, $5
129 writemsg "[19] Test ALUIPC"
130 jal GetPC
132 addiu $4, $6, 16
133 aui $4, $4, 8
134 li $7, 0xffff0000
135 and $4, $4, $7
136 aluipc $5, 8
137 fp_assert $4, $5
139 writemsg "[20] Test LWPC"
140 lw $5, dval1
141 lwpc $4, dval1
142 fp_assert $4, $5
143 lw $5, dval2
144 lwpc $4, dval2
145 fp_assert $4, $5
147 writemsg "[21] Test LL"
148 lw $5, dval2
149 la $3, dval3
150 ll $4, -252($3)
151 fp_assert $4, $5
153 writemsg "[22] Test SC"
154 ll $4, -252($3)
155 li $4, 0xafaf
156 sc $4, -252($3)
157 lw $5, dval2
158 li $4, 0xafaf
159 fp_assert $4, $5
161 pass
163 .end DIAG