xref: /openbmc/qemu/tests/tcg/xtensa/test_extui.S (revision 739aa555)
1#include "macros.inc"
2
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
27