Skip to content

Commit 87d44ba

Browse files
author
Clément Chigot
committed
Zend/asm: adjust XCOFF64 asm files for AIX assembler
AIX assembler is a bit more strict than GNU assembler. Thus, adjust the XCOFF asm files to be able to accept both assembler.
1 parent 89007f6 commit 87d44ba

File tree

2 files changed

+146
-11
lines changed

2 files changed

+146
-11
lines changed

Zend/asm/jump_ppc64_sysv_xcoff_gas.S

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,77 @@
66
http://www.boost.org/LICENSE_1_0.txt)
77
*/
88

9-
.align 2
10-
.globl .jump_fcontext
9+
/*******************************************************
10+
* *
11+
* ------------------------------------------------- *
12+
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | *
13+
* ------------------------------------------------- *
14+
* | 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | *
15+
* ------------------------------------------------- *
16+
* | TOC | R14 | R15 | R16 | *
17+
* ------------------------------------------------- *
18+
* ------------------------------------------------- *
19+
* | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *
20+
* ------------------------------------------------- *
21+
* | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | *
22+
* ------------------------------------------------- *
23+
* | R17 | R18 | R19 | R20 | *
24+
* ------------------------------------------------- *
25+
* ------------------------------------------------- *
26+
* | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | *
27+
* ------------------------------------------------- *
28+
* | 64 | 68 | 72 | 76 | 80 | 84 | 88 | 92 | *
29+
* ------------------------------------------------- *
30+
* | R21 | R22 | R23 | R24 | *
31+
* ------------------------------------------------- *
32+
* ------------------------------------------------- *
33+
* | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | *
34+
* ------------------------------------------------- *
35+
* | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | *
36+
* ------------------------------------------------- *
37+
* | R25 | R26 | R27 | R28 | *
38+
* ------------------------------------------------- *
39+
* ------------------------------------------------- *
40+
* | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | *
41+
* ------------------------------------------------- *
42+
* | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | *
43+
* ------------------------------------------------- *
44+
* | R29 | R30 | R31 | hidden | *
45+
* ------------------------------------------------- *
46+
* ------------------------------------------------- *
47+
* | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | *
48+
* ------------------------------------------------- *
49+
* | 160 | 164 | 168 | 172 | 176 | 180 | 184 | 188 | *
50+
* ------------------------------------------------- *
51+
* | CR | LR | PC | back-chain| *
52+
* ------------------------------------------------- *
53+
* ------------------------------------------------- *
54+
* | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | *
55+
* ------------------------------------------------- *
56+
* | 192 | 196 | 200 | 204 | 208 | 212 | 216 | 220 | *
57+
* ------------------------------------------------- *
58+
* | cr saved | lr saved | compiler | linker | *
59+
* ------------------------------------------------- *
60+
* ------------------------------------------------- *
61+
* | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | *
62+
* ------------------------------------------------- *
63+
* | 224 | 228 | 232 | 236 | 240 | 244 | 248 | 252 | *
64+
* ------------------------------------------------- *
65+
* | TOC saved | FCTX | DATA | | *
66+
* ------------------------------------------------- *
67+
* *
68+
*******************************************************/
69+
70+
.file "jump_ppc64_sysv_xcoff_gas.S"
71+
.toc
72+
.csect .text[PR], 5
73+
.align 2
74+
.globl jump_fcontext[DS]
75+
.globl .jump_fcontext
76+
.csect jump_fcontext[DS], 3
77+
jump_fcontext:
78+
.llong .jump_fcontext[PR], TOC[tc0], 0
79+
.csect .text[PR], 5
1180
.jump_fcontext:
1281
# reserve space on stack
1382
subi 1, 1, 184
@@ -27,7 +96,7 @@
2796
std 25, 96(1) # save R25
2897
std 26, 104(1) # save R26
2998
std 27, 112(1) # save R27
30-
std 29, 120(1) # save R28
99+
std 28, 120(1) # save R28
31100
std 29, 128(1) # save R29
32101
std 30, 136(1) # save R30
33102
std 31, 144(1) # save R31

Zend/asm/make_ppc64_sysv_xcoff_gas.S

Lines changed: 74 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,79 @@
44
(See accompanying file LICENSE_1_0.txt or copy at
55
http://www.boost.org/LICENSE_1_0.txt)
66
*/
7-
.globl make_fcontext[DS]
8-
.globl .make_fcontext[PR]
9-
.align 2
10-
.csect .make_fcontext[PR], 3
11-
.globl _make_fcontext
12-
#._make_fcontext:
7+
8+
/*******************************************************
9+
* *
10+
* ------------------------------------------------- *
11+
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | *
12+
* ------------------------------------------------- *
13+
* | 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | *
14+
* ------------------------------------------------- *
15+
* | TOC | R14 | R15 | R16 | *
16+
* ------------------------------------------------- *
17+
* ------------------------------------------------- *
18+
* | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *
19+
* ------------------------------------------------- *
20+
* | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | *
21+
* ------------------------------------------------- *
22+
* | R17 | R18 | R19 | R20 | *
23+
* ------------------------------------------------- *
24+
* ------------------------------------------------- *
25+
* | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | *
26+
* ------------------------------------------------- *
27+
* | 64 | 68 | 72 | 76 | 80 | 84 | 88 | 92 | *
28+
* ------------------------------------------------- *
29+
* | R21 | R22 | R23 | R24 | *
30+
* ------------------------------------------------- *
31+
* ------------------------------------------------- *
32+
* | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | *
33+
* ------------------------------------------------- *
34+
* | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | *
35+
* ------------------------------------------------- *
36+
* | R25 | R26 | R27 | R28 | *
37+
* ------------------------------------------------- *
38+
* ------------------------------------------------- *
39+
* | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | *
40+
* ------------------------------------------------- *
41+
* | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | *
42+
* ------------------------------------------------- *
43+
* | R29 | R30 | R31 | hidden | *
44+
* ------------------------------------------------- *
45+
* ------------------------------------------------- *
46+
* | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | *
47+
* ------------------------------------------------- *
48+
* | 160 | 164 | 168 | 172 | 176 | 180 | 184 | 188 | *
49+
* ------------------------------------------------- *
50+
* | CR | LR | PC | back-chain| *
51+
* ------------------------------------------------- *
52+
* ------------------------------------------------- *
53+
* | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | *
54+
* ------------------------------------------------- *
55+
* | 192 | 196 | 200 | 204 | 208 | 212 | 216 | 220 | *
56+
* ------------------------------------------------- *
57+
* | cr saved | lr saved | compiler | linker | *
58+
* ------------------------------------------------- *
59+
* ------------------------------------------------- *
60+
* | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | *
61+
* ------------------------------------------------- *
62+
* | 224 | 228 | 232 | 236 | 240 | 244 | 248 | 252 | *
63+
* ------------------------------------------------- *
64+
* | TOC saved | FCTX | DATA | | *
65+
* ------------------------------------------------- *
66+
* *
67+
*******************************************************/
68+
69+
.file "make_ppc64_sysv_xcoff_gas.S"
70+
.toc
71+
.csect .text[PR], 5
72+
.align 2
73+
.globl make_fcontext[DS]
74+
.globl .make_fcontext
75+
.csect make_fcontext[DS], 3
76+
make_fcontext:
77+
.llong .make_fcontext[PR], TOC[tc0], 0
78+
.csect .text[PR], 5
79+
.make_fcontext:
1380
# save return address into R6
1481
mflr 6
1582

@@ -21,8 +88,7 @@
2188
# including 64 byte of linkage + parameter area (R1 % 16 == 0)
2289
subi 3, 3, 248
2390

24-
# third arg of make_fcontext() == address of context-function
25-
# (upstream boost ignored the fact this is a function descriptor)
91+
# third arg of make_fcontext() == address of context-function descriptor
2692
ld 4, 0(5)
2793
std 4, 176(3)
2894
# save TOC of context-function

0 commit comments

Comments
 (0)