xref: /openbmc/qemu/tests/tcg/xtensa/test_clamps.S (revision d6032e06)
1#include "macros.inc"
2
3test_suite clamps
4
5test clamps
6    movi    a2, 0
7    movi    a3, 0
8    clamps  a4, a2, 7
9    assert  eq, a3, a4
10
11    movi    a2, 0x7f
12    movi    a3, 0x7f
13    clamps  a4, a2, 7
14    assert  eq, a3, a4
15
16    movi    a2, 0xffffff80
17    movi    a3, 0xffffff80
18    clamps  a4, a2, 7
19    assert  eq, a3, a4
20
21    movi    a2, 0x80
22    movi    a3, 0x7f
23    clamps  a2, a2, 7
24    assert  eq, a3, a2
25
26    movi    a2, 0xffffff7f
27    movi    a3, 0xffffff80
28    clamps  a2, a2, 7
29    assert  eq, a3, a2
30
31    movi    a2, 0x7fffffff
32    movi    a3, 0x7f
33    clamps  a2, a2, 7
34    assert  eq, a3, a2
35
36    movi    a2, 0x80000000
37    movi    a3, 0xffffff80
38    clamps  a2, a2, 7
39    assert  eq, a3, a2
40test_end
41
42test_suite_end
43