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