xref: /openbmc/qemu/tests/tcg/hexagon/test_clobber.S (revision c5ea91da443b458352c1b629b490ee6631775cb4)
1585a86b1SNiccolò Izzo/*
2*6c67d98cSMichael Tokarev * Purpose: demonstrate the successful operation of the register save mechanism,
3585a86b1SNiccolò Izzo * in which the caller saves the registers that will be clobbered, and restores
4585a86b1SNiccolò Izzo * them after the call.
5585a86b1SNiccolò Izzo */
6585a86b1SNiccolò Izzo
7585a86b1SNiccolò Izzo    .text
8585a86b1SNiccolò Izzo    .globl _start
9585a86b1SNiccolò Izzo
10585a86b1SNiccolò Izzo_start:
11585a86b1SNiccolò Izzo    allocframe(#8)
12585a86b1SNiccolò Izzo    {
13585a86b1SNiccolò Izzo        r16 = #47
14585a86b1SNiccolò Izzo        r17 = #155
15585a86b1SNiccolò Izzo    }
16585a86b1SNiccolò Izzo    memd(sp+#0) = r17:16
17585a86b1SNiccolò Izzo    {
18585a86b1SNiccolò Izzo        r16 = #255
19585a86b1SNiccolò Izzo        r17 = #42
20585a86b1SNiccolò Izzo    }
21585a86b1SNiccolò Izzo    {
22585a86b1SNiccolò Izzo        deallocframe
23585a86b1SNiccolò Izzo        r17:16 = memd(sp+#0)
24585a86b1SNiccolò Izzo    }
25585a86b1SNiccolò Izzo    {
26585a86b1SNiccolò Izzo        p0 = cmp.eq(r16, #47)
27585a86b1SNiccolò Izzo        p0 = cmp.eq(r17, #155); if (p0.new) jump:t pass
28585a86b1SNiccolò Izzo        jump fail
29585a86b1SNiccolò Izzo    }
30