xref: /qemu/tests/tcg/hexagon/test_bitcnt.S (revision f969c627)
1/*
2 * Purpose: test example, verify the soundness of the cl[01] operations.
3 *
4 * The number 0x000001aa has 23 leading zeroes
5 * they become 55 when considered as 64 bit register
6 * and it has 1 trailing zero.
7 */
8    .text
9    .globl _start
10
11_start:
12    {
13        r0 = #426
14        r1 = #0
15    }
16    {
17        r2 = cl0(r0)
18    }
19    {
20        p0 = cmp.eq(r2, #23); if (p0.new) jump:t test2
21        jump fail
22    }
23
24test2:
25    {
26        r2 = cl0(r1:0)
27    }
28    {
29        p0 = cmp.eq(r2, #55); if (p0.new) jump:t test3
30        jump fail
31    }
32
33test3:
34    {
35        r2 = ct0(r0)
36    }
37    {
38        p0 = cmp.eq(r2, #1); if (p0.new) jump:t pass
39        jump fail
40    }
41