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