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