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 | |
16 | .equ IC, 2 # Indirect call from "compressed" code | |
17 | .equ DU, 4 # Direct call from "uncompressed" code | |
18 | .equ IU, 8 # Indirect call from "uncompressed" code | |
19 | .equ LO, 16 # Direct address reference (%lo) | |
20 | ||
21 | # A wrapper around a macro called test_one, which is defined by | |
22 | # the file that includes this one. NAME is the name of a function | |
23 | # that is referenced in the way described by FLAGS, an inclusive OR | |
24 | # of the flags above. The wrapper filters out any functions whose | |
25 | # FLAGS are not a subset of FILTER. | |
26 | ||
27 | .macro test_filter, name, flags | |
28 | .if (\flags & filter) == \flags | |
29 | test_one \name, \flags | |
30 | .endif | |
31 | .endm | |
32 | ||
33 | .macro test_all_dc, name, flags | |
34 | test_filter \name, \flags | |
35 | test_filter \name\()_dc, (\flags | DC) | |
36 | .endm | |
37 | ||
38 | .macro test_all_ic, name, flags | |
39 | test_all_dc \name, \flags | |
40 | test_all_dc \name\()_ic, (\flags | IC) | |
41 | .endm | |
42 | ||
43 | .macro test_all_du, name, flags | |
44 | test_all_ic \name, \flags | |
45 | test_all_ic \name\()_du, (\flags | DU) | |
46 | .endm | |
47 | ||
48 | .macro test_all_iu, name, flags | |
49 | test_all_du \name, \flags | |
50 | test_all_du \name\()_iu, (\flags | IU) | |
51 | .endm | |
52 | ||
53 | .macro test_all_lo, name, flags | |
54 | test_all_iu \name, \flags | |
55 | test_all_iu \name\()_lo, (\flags | LO) | |
56 | .endm | |
57 | ||
58 | # Test all the combinations of interest. | |
59 | ||
60 | .macro test_all | |
61 | test_all_lo f, 0 | |
62 | .endm |