c-ppc.texi revision 1.1.1.8 1 1.1.1.8 christos @c Copyright (C) 2001-2020 Free Software Foundation, Inc.
2 1.1 skrll @c This is part of the GAS manual.
3 1.1 skrll @c For copying conditions, see the file as.texinfo.
4 1.1.1.4 christos @c man end
5 1.1 skrll @ifset GENERIC
6 1.1 skrll @page
7 1.1 skrll @node PPC-Dependent
8 1.1 skrll @chapter PowerPC Dependent Features
9 1.1 skrll @end ifset
10 1.1 skrll @ifclear GENERIC
11 1.1 skrll @node Machine Dependencies
12 1.1 skrll @chapter PowerPC Dependent Features
13 1.1 skrll @end ifclear
14 1.1 skrll
15 1.1 skrll @cindex PowerPC support
16 1.1 skrll @menu
17 1.1 skrll * PowerPC-Opts:: Options
18 1.1 skrll * PowerPC-Pseudo:: PowerPC Assembler Directives
19 1.1.1.4 christos * PowerPC-Syntax:: PowerPC Syntax
20 1.1 skrll @end menu
21 1.1 skrll
22 1.1 skrll @node PowerPC-Opts
23 1.1 skrll @section Options
24 1.1 skrll
25 1.1 skrll @cindex options for PowerPC
26 1.1 skrll @cindex PowerPC options
27 1.1 skrll @cindex architectures, PowerPC
28 1.1 skrll @cindex PowerPC architectures
29 1.1 skrll The PowerPC chip family includes several successive levels, using the same
30 1.1 skrll core instruction set, but including a few additional instructions at
31 1.1 skrll each level. There are exceptions to this however. For details on what
32 1.1 skrll instructions each variant supports, please see the chip's architecture
33 1.1 skrll reference manual.
34 1.1 skrll
35 1.1 skrll The following table lists all available PowerPC options.
36 1.1 skrll
37 1.1.1.4 christos @c man begin OPTIONS
38 1.1.1.4 christos @table @gcctabopt
39 1.1.1.3 christos @item -a32
40 1.1.1.3 christos Generate ELF32 or XCOFF32.
41 1.1.1.3 christos
42 1.1.1.3 christos @item -a64
43 1.1.1.3 christos Generate ELF64 or XCOFF64.
44 1.1.1.3 christos
45 1.1.1.3 christos @item -K PIC
46 1.1.1.3 christos Set EF_PPC_RELOCATABLE_LIB in ELF flags.
47 1.1.1.3 christos
48 1.1 skrll @item -mpwrx | -mpwr2
49 1.1 skrll Generate code for POWER/2 (RIOS2).
50 1.1 skrll
51 1.1 skrll @item -mpwr
52 1.1 skrll Generate code for POWER (RIOS1)
53 1.1 skrll
54 1.1 skrll @item -m601
55 1.1 skrll Generate code for PowerPC 601.
56 1.1 skrll
57 1.1 skrll @item -mppc, -mppc32, -m603, -m604
58 1.1 skrll Generate code for PowerPC 603/604.
59 1.1 skrll
60 1.1 skrll @item -m403, -m405
61 1.1 skrll Generate code for PowerPC 403/405.
62 1.1 skrll
63 1.1 skrll @item -m440
64 1.1 skrll Generate code for PowerPC 440. BookE and some 405 instructions.
65 1.1 skrll
66 1.1.1.3 christos @item -m464
67 1.1.1.3 christos Generate code for PowerPC 464.
68 1.1.1.3 christos
69 1.1.1.3 christos @item -m476
70 1.1.1.3 christos Generate code for PowerPC 476.
71 1.1.1.3 christos
72 1.1 skrll @item -m7400, -m7410, -m7450, -m7455
73 1.1 skrll Generate code for PowerPC 7400/7410/7450/7455.
74 1.1 skrll
75 1.1.1.8 christos @item -m750cl, -mgekko, -mbroadway
76 1.1.1.8 christos Generate code for PowerPC 750CL/Gekko/Broadway.
77 1.1 skrll
78 1.1.1.5 christos @item -m821, -m850, -m860
79 1.1.1.5 christos Generate code for PowerPC 821/850/860.
80 1.1.1.5 christos
81 1.1 skrll @item -mppc64, -m620
82 1.1 skrll Generate code for PowerPC 620/625/630.
83 1.1 skrll
84 1.1 skrll @item -me500, -me500x2
85 1.1 skrll Generate code for Motorola e500 core complex.
86 1.1 skrll
87 1.1.1.3 christos @item -me500mc
88 1.1.1.3 christos Generate code for Freescale e500mc core complex.
89 1.1.1.3 christos
90 1.1.1.3 christos @item -me500mc64
91 1.1.1.3 christos Generate code for Freescale e500mc64 core complex.
92 1.1.1.3 christos
93 1.1.1.4 christos @item -me5500
94 1.1.1.4 christos Generate code for Freescale e5500 core complex.
95 1.1.1.4 christos
96 1.1.1.4 christos @item -me6500
97 1.1.1.4 christos Generate code for Freescale e6500 core complex.
98 1.1.1.4 christos
99 1.1 skrll @item -mspe
100 1.1 skrll Generate code for Motorola SPE instructions.
101 1.1 skrll
102 1.1.1.7 christos @item -mspe2
103 1.1.1.7 christos Generate code for Freescale SPE2 instructions.
104 1.1.1.7 christos
105 1.1.1.3 christos @item -mtitan
106 1.1.1.3 christos Generate code for AppliedMicro Titan core complex.
107 1.1.1.3 christos
108 1.1 skrll @item -mppc64bridge
109 1.1 skrll Generate code for PowerPC 64, including bridge insns.
110 1.1 skrll
111 1.1.1.2 skrll @item -mbooke
112 1.1 skrll Generate code for 32-bit BookE.
113 1.1 skrll
114 1.1.1.3 christos @item -ma2
115 1.1.1.3 christos Generate code for A2 architecture.
116 1.1.1.3 christos
117 1.1 skrll @item -me300
118 1.1 skrll Generate code for PowerPC e300 family.
119 1.1 skrll
120 1.1 skrll @item -maltivec
121 1.1 skrll Generate code for processors with AltiVec instructions.
122 1.1 skrll
123 1.1.1.5 christos @item -mvle
124 1.1.1.5 christos Generate code for Freescale PowerPC VLE instructions.
125 1.1.1.5 christos
126 1.1 skrll @item -mvsx
127 1.1 skrll Generate code for processors with Vector-Scalar (VSX) instructions.
128 1.1 skrll
129 1.1.1.5 christos @item -mhtm
130 1.1.1.5 christos Generate code for processors with Hardware Transactional Memory instructions.
131 1.1.1.5 christos
132 1.1.1.3 christos @item -mpower4, -mpwr4
133 1.1 skrll Generate code for Power4 architecture.
134 1.1 skrll
135 1.1.1.3 christos @item -mpower5, -mpwr5, -mpwr5x
136 1.1 skrll Generate code for Power5 architecture.
137 1.1 skrll
138 1.1.1.3 christos @item -mpower6, -mpwr6
139 1.1 skrll Generate code for Power6 architecture.
140 1.1 skrll
141 1.1.1.3 christos @item -mpower7, -mpwr7
142 1.1 skrll Generate code for Power7 architecture.
143 1.1 skrll
144 1.1.1.5 christos @item -mpower8, -mpwr8
145 1.1.1.5 christos Generate code for Power8 architecture.
146 1.1.1.5 christos
147 1.1.1.5 christos @item -mpower9, -mpwr9
148 1.1.1.5 christos Generate code for Power9 architecture.
149 1.1.1.5 christos
150 1.1.1.5 christos @item -mcell
151 1.1 skrll @item -mcell
152 1.1 skrll Generate code for Cell Broadband Engine architecture.
153 1.1 skrll
154 1.1 skrll @item -mcom
155 1.1 skrll Generate code Power/PowerPC common instructions.
156 1.1 skrll
157 1.1 skrll @item -many
158 1.1 skrll Generate code for any architecture (PWR/PWRX/PPC).
159 1.1 skrll
160 1.1 skrll @item -mregnames
161 1.1 skrll Allow symbolic names for registers.
162 1.1 skrll
163 1.1 skrll @item -mno-regnames
164 1.1 skrll Do not allow symbolic names for registers.
165 1.1 skrll
166 1.1 skrll @item -mrelocatable
167 1.1 skrll Support for GCC's -mrelocatable option.
168 1.1 skrll
169 1.1 skrll @item -mrelocatable-lib
170 1.1 skrll Support for GCC's -mrelocatable-lib option.
171 1.1 skrll
172 1.1 skrll @item -memb
173 1.1 skrll Set PPC_EMB bit in ELF flags.
174 1.1 skrll
175 1.1.1.3 christos @item -mlittle, -mlittle-endian, -le
176 1.1 skrll Generate code for a little endian machine.
177 1.1 skrll
178 1.1.1.3 christos @item -mbig, -mbig-endian, -be
179 1.1 skrll Generate code for a big endian machine.
180 1.1 skrll
181 1.1 skrll @item -msolaris
182 1.1 skrll Generate code for Solaris.
183 1.1 skrll
184 1.1 skrll @item -mno-solaris
185 1.1 skrll Do not generate code for Solaris.
186 1.1.1.3 christos
187 1.1.1.3 christos @item -nops=@var{count}
188 1.1.1.3 christos If an alignment directive inserts more than @var{count} nops, put a
189 1.1.1.3 christos branch at the beginning to skip execution of the nops.
190 1.1 skrll @end table
191 1.1.1.4 christos @c man end
192 1.1 skrll
193 1.1 skrll
194 1.1 skrll @node PowerPC-Pseudo
195 1.1 skrll @section PowerPC Assembler Directives
196 1.1 skrll
197 1.1 skrll @cindex directives for PowerPC
198 1.1 skrll @cindex PowerPC directives
199 1.1 skrll A number of assembler directives are available for PowerPC. The
200 1.1 skrll following table is far from complete.
201 1.1 skrll
202 1.1 skrll @table @code
203 1.1 skrll @item .machine "string"
204 1.1 skrll This directive allows you to change the machine for which code is
205 1.1 skrll generated. @code{"string"} may be any of the -m cpu selection options
206 1.1 skrll (without the -m) enclosed in double quotes, @code{"push"}, or
207 1.1 skrll @code{"pop"}. @code{.machine "push"} saves the currently selected
208 1.1 skrll cpu, which may be restored with @code{.machine "pop"}.
209 1.1 skrll @end table
210 1.1.1.4 christos
211 1.1.1.4 christos @node PowerPC-Syntax
212 1.1.1.4 christos @section PowerPC Syntax
213 1.1.1.4 christos @menu
214 1.1.1.4 christos * PowerPC-Chars:: Special Characters
215 1.1.1.4 christos @end menu
216 1.1.1.4 christos
217 1.1.1.4 christos @node PowerPC-Chars
218 1.1.1.4 christos @subsection Special Characters
219 1.1.1.4 christos
220 1.1.1.4 christos @cindex line comment character, PowerPC
221 1.1.1.4 christos @cindex PowerPC line comment character
222 1.1.1.4 christos The presence of a @samp{#} on a line indicates the start of a comment
223 1.1.1.4 christos that extends to the end of the current line.
224 1.1.1.4 christos
225 1.1.1.4 christos If a @samp{#} appears as the first character of a line then the whole
226 1.1.1.4 christos line is treated as a comment, but in this case the line could also be
227 1.1.1.4 christos a logical line number directive (@pxref{Comments}) or a preprocessor
228 1.1.1.4 christos control command (@pxref{Preprocessing}).
229 1.1.1.4 christos
230 1.1.1.4 christos If the assembler has been configured for the ppc-*-solaris* target
231 1.1.1.4 christos then the @samp{!} character also acts as a line comment character.
232 1.1.1.8 christos This can be disabled via the @option{-mno-solaris} command-line
233 1.1.1.4 christos option.
234 1.1.1.4 christos
235 1.1.1.4 christos @cindex line separator, PowerPC
236 1.1.1.4 christos @cindex statement separator, PowerPC
237 1.1.1.4 christos @cindex PowerPC line separator
238 1.1.1.4 christos The @samp{;} character can be used to separate statements on the same
239 1.1.1.4 christos line.
240