blob: c32bb824dfd3935375b8f5a5af2049ca13f9534a [file] [log] [blame]
Max Filippova2e67072014-02-10 20:20:52 +04001#include "macros.inc"
Max Filippov7be9d0e2012-12-17 00:32:27 +04002
3test_suite extui
4
5.macro test_extui v, shiftimm, maskimm
6 .if \shiftimm + \maskimm <= 32
7 movi a2, \v
8 extui a3, a2, \shiftimm, \maskimm
9 movi a4, ((\v) >> (\shiftimm)) & ((1 << (\maskimm)) - 1)
10 assert eq, a3, a4
11 .endif
12.endm
13
14test extui
15 .set shiftimm, 0
16 .rept 32
17 .set maskimm, 1
18 .rept 16
19 test_extui 0xc8df1370, shiftimm, maskimm
20 .set maskimm, maskimm + 1
21 .endr
22 .set shiftimm, shiftimm + 1
23 .endr
24test_end
25
26test_suite_end