Commit | Line | Data |
---|---|---|
690f47bf RS |
1 | .macro call_stub, name |
2 | .set push | |
3 | .set nomips16 | |
4 | .section .mips16.call.\name, "ax", @progbits | |
5 | .ent __call_stub_\name | |
6 | .type __call_stub_\name, @function | |
7 | __call_stub_\name: | |
8 | la $25, \name | |
9 | jr $25 | |
10 | .set pop | |
11 | .endm | |
12 | ||
13 | # Flags to specify how a particular function is referenced | |
14 | ||
15 | .equ DC, 1 # Direct call from "compressed" code | |
54806ffa MR |
16 | .equ BC, 2 # Branch from "compressed" code |
17 | .equ IC, 4 # Indirect call from "compressed" code | |
18 | .equ DU, 8 # Direct call from "uncompressed" code | |
19 | .equ BU, 16 # Branch from "uncompressed" code | |
20 | .equ IU, 32 # Indirect call from "uncompressed" code | |
21 | .equ LO, 64 # Direct address reference (%lo) | |
690f47bf RS |
22 | |
23 | # A wrapper around a macro called test_one, which is defined by | |
24 | # the file that includes this one. NAME is the name of a function | |
25 | # that is referenced in the way described by FLAGS, an inclusive OR | |
26 | # of the flags above. The wrapper filters out any functions whose | |
27 | # FLAGS are not a subset of FILTER. | |
28 | ||
29 | .macro test_filter, name, flags | |
30 | .if (\flags & filter) == \flags | |
31 | test_one \name, \flags | |
32 | .endif | |
33 | .endm | |
34 | ||
35 | .macro test_all_dc, name, flags | |
36 | test_filter \name, \flags | |
37 | test_filter \name\()_dc, (\flags | DC) | |
38 | .endm | |
39 | ||
54806ffa | 40 | .macro test_all_bc, name, flags |
690f47bf | 41 | test_all_dc \name, \flags |
54806ffa MR |
42 | test_all_dc \name\()_bc, (\flags | BC) |
43 | .endm | |
44 | ||
45 | .macro test_all_ic, name, flags | |
46 | test_all_bc \name, \flags | |
47 | test_all_bc \name\()_ic, (\flags | IC) | |
690f47bf RS |
48 | .endm |
49 | ||
50 | .macro test_all_du, name, flags | |
51 | test_all_ic \name, \flags | |
52 | test_all_ic \name\()_du, (\flags | DU) | |
53 | .endm | |
54 | ||
54806ffa | 55 | .macro test_all_bu, name, flags |
690f47bf | 56 | test_all_du \name, \flags |
54806ffa MR |
57 | test_all_du \name\()_bu, (\flags | BU) |
58 | .endm | |
59 | ||
60 | .macro test_all_iu, name, flags | |
61 | test_all_bu \name, \flags | |
62 | test_all_bu \name\()_iu, (\flags | IU) | |
690f47bf RS |
63 | .endm |
64 | ||
65 | .macro test_all_lo, name, flags | |
66 | test_all_iu \name, \flags | |
67 | test_all_iu \name\()_lo, (\flags | LO) | |
68 | .endm | |
69 | ||
70 | # Test all the combinations of interest. | |
71 | ||
72 | .macro test_all | |
73 | test_all_lo f, 0 | |
74 | .endm |