aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/hexagon/test_reorder.S
blob: 5ee05398361157600b59a74df4a6c8cd6a7dc6c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * Purpose: demonstrate handling of .new uses appearing before the associated
 * definition.
 * Here we perform a jump that skips the code resetting R2 from 0xDEADBEEF to 0,
 * only if P0.new is true, but P0 is assigned to 1 (R4) in the next instruction
 * in the packet.
 */

    .text
    .globl _start

_start:
    {
        r2 = #-559038737
    }
    {
        r4 = #1
    }
    {
        if (p0.new) jump:nt skip
        p0 = r4;
    }

fallthrough:
    {
        r2 = #0
    }

skip:
    {
        p0 = cmp.eq(r2, #-559038737); if (p0.new) jump:t pass
        jump fail
    }