Rebase.
[official-gcc.git] / gcc / testsuite / gcc.target / mips / branch-helper.h
blob85399be4c7df5c5330c138c8ee8c958eb50c3596
1 /* DN(X) generates 2**N copies of asm instruction X. */
2 #define D0(X) X
3 #define D1(X) X "\n\t" X
4 #define D2(X) D1 (D1 (X))
5 #define D3(X) D2 (D1 (X))
6 #define D4(X) D2 (D2 (X))
7 #define D5(X) D4 (D1 (X))
8 #define D6(X) D4 (D2 (X))
9 #define D7(X) D4 (D2 (D1 (X)))
10 #define D8(X) D4 (D4 (X))
11 #define D9(X) D8 (D1 (X))
12 #define D10(X) D8 (D2 (X))
13 #define D11(X) D8 (D2 (D1 (X)))
14 #define D12(X) D8 (D4 (X))
15 #define D13(X) D8 (D4 (D1 (X)))
16 #define D14(X) D8 (D4 (D2 (X)))
18 /* Emit something that is 0x1fff8 bytes long, which is the largest
19 permissible range for non-MIPS16 forward branches. */
20 #define OCCUPY_0x1fff8 \
21 asm (D14 ("nop") "\n\t" \
22 D13 ("nop") "\n\t" \
23 D12 ("nop") "\n\t" \
24 D11 ("nop") "\n\t" \
25 D10 ("nop") "\n\t" \
26 D9 ("nop") "\n\t" \
27 D8 ("nop") "\n\t" \
28 D7 ("nop") "\n\t" \
29 D6 ("nop") "\n\t" \
30 D5 ("nop") "\n\t" \
31 D4 ("nop") "\n\t" \
32 D3 ("nop") "\n\t" \
33 D2 ("nop") "\n\t" \
34 D1 ("nop"))
36 /* Likewise emit something that is 0x1fffc bytes long. */
37 #define OCCUPY_0x1fffc do { asm ("nop"); OCCUPY_0x1fff8; } while (0)