1*e072ec67Schristos@c Copyright (C) 2001-2022 Free Software Foundation, Inc. 22a6b7db3Sskrll@c This is part of the GAS manual. 32a6b7db3Sskrll@c For copying conditions, see the file as.texinfo. 44c43201bSchristos@c man end 52a6b7db3Sskrll@ifset GENERIC 62a6b7db3Sskrll@page 72a6b7db3Sskrll@node PPC-Dependent 82a6b7db3Sskrll@chapter PowerPC Dependent Features 92a6b7db3Sskrll@end ifset 102a6b7db3Sskrll@ifclear GENERIC 112a6b7db3Sskrll@node Machine Dependencies 122a6b7db3Sskrll@chapter PowerPC Dependent Features 132a6b7db3Sskrll@end ifclear 142a6b7db3Sskrll 152a6b7db3Sskrll@cindex PowerPC support 162a6b7db3Sskrll@menu 172a6b7db3Sskrll* PowerPC-Opts:: Options 182a6b7db3Sskrll* PowerPC-Pseudo:: PowerPC Assembler Directives 194c43201bSchristos* PowerPC-Syntax:: PowerPC Syntax 202a6b7db3Sskrll@end menu 212a6b7db3Sskrll 222a6b7db3Sskrll@node PowerPC-Opts 232a6b7db3Sskrll@section Options 242a6b7db3Sskrll 252a6b7db3Sskrll@cindex options for PowerPC 262a6b7db3Sskrll@cindex PowerPC options 272a6b7db3Sskrll@cindex architectures, PowerPC 282a6b7db3Sskrll@cindex PowerPC architectures 292a6b7db3SskrllThe PowerPC chip family includes several successive levels, using the same 302a6b7db3Sskrllcore instruction set, but including a few additional instructions at 312a6b7db3Sskrlleach level. There are exceptions to this however. For details on what 322a6b7db3Sskrllinstructions each variant supports, please see the chip's architecture 332a6b7db3Sskrllreference manual. 342a6b7db3Sskrll 352a6b7db3SskrllThe following table lists all available PowerPC options. 362a6b7db3Sskrll 374c43201bSchristos@c man begin OPTIONS 384c43201bSchristos@table @gcctabopt 398443c5fcSchristos@item -a32 408443c5fcSchristosGenerate ELF32 or XCOFF32. 418443c5fcSchristos 428443c5fcSchristos@item -a64 438443c5fcSchristosGenerate ELF64 or XCOFF64. 448443c5fcSchristos 458443c5fcSchristos@item -K PIC 468443c5fcSchristosSet EF_PPC_RELOCATABLE_LIB in ELF flags. 478443c5fcSchristos 482a6b7db3Sskrll@item -mpwrx | -mpwr2 492a6b7db3SskrllGenerate code for POWER/2 (RIOS2). 502a6b7db3Sskrll 512a6b7db3Sskrll@item -mpwr 522a6b7db3SskrllGenerate code for POWER (RIOS1) 532a6b7db3Sskrll 542a6b7db3Sskrll@item -m601 552a6b7db3SskrllGenerate code for PowerPC 601. 562a6b7db3Sskrll 572a6b7db3Sskrll@item -mppc, -mppc32, -m603, -m604 582a6b7db3SskrllGenerate code for PowerPC 603/604. 592a6b7db3Sskrll 602a6b7db3Sskrll@item -m403, -m405 612a6b7db3SskrllGenerate code for PowerPC 403/405. 622a6b7db3Sskrll 632a6b7db3Sskrll@item -m440 642a6b7db3SskrllGenerate code for PowerPC 440. BookE and some 405 instructions. 652a6b7db3Sskrll 668443c5fcSchristos@item -m464 678443c5fcSchristosGenerate code for PowerPC 464. 688443c5fcSchristos 698443c5fcSchristos@item -m476 708443c5fcSchristosGenerate code for PowerPC 476. 718443c5fcSchristos 722a6b7db3Sskrll@item -m7400, -m7410, -m7450, -m7455 732a6b7db3SskrllGenerate code for PowerPC 7400/7410/7450/7455. 742a6b7db3Sskrll 75c21fdd85Schristos@item -m750cl, -mgekko, -mbroadway 76c21fdd85SchristosGenerate code for PowerPC 750CL/Gekko/Broadway. 772a6b7db3Sskrll 78438aacb6Schristos@item -m821, -m850, -m860 79438aacb6SchristosGenerate code for PowerPC 821/850/860. 80438aacb6Schristos 812a6b7db3Sskrll@item -mppc64, -m620 822a6b7db3SskrllGenerate code for PowerPC 620/625/630. 832a6b7db3Sskrll 842a6b7db3Sskrll@item -me500, -me500x2 852a6b7db3SskrllGenerate code for Motorola e500 core complex. 862a6b7db3Sskrll 878443c5fcSchristos@item -me500mc 888443c5fcSchristosGenerate code for Freescale e500mc core complex. 898443c5fcSchristos 908443c5fcSchristos@item -me500mc64 918443c5fcSchristosGenerate code for Freescale e500mc64 core complex. 928443c5fcSchristos 934c43201bSchristos@item -me5500 944c43201bSchristosGenerate code for Freescale e5500 core complex. 954c43201bSchristos 964c43201bSchristos@item -me6500 974c43201bSchristosGenerate code for Freescale e6500 core complex. 984c43201bSchristos 992a6b7db3Sskrll@item -mspe 1002a6b7db3SskrllGenerate code for Motorola SPE instructions. 1012a6b7db3Sskrll 102aa4b58b1Schristos@item -mspe2 103aa4b58b1SchristosGenerate code for Freescale SPE2 instructions. 104aa4b58b1Schristos 1058443c5fcSchristos@item -mtitan 1068443c5fcSchristosGenerate code for AppliedMicro Titan core complex. 1078443c5fcSchristos 1082a6b7db3Sskrll@item -mppc64bridge 1092a6b7db3SskrllGenerate code for PowerPC 64, including bridge insns. 1102a6b7db3Sskrll 111af515df4Sskrll@item -mbooke 1122a6b7db3SskrllGenerate code for 32-bit BookE. 1132a6b7db3Sskrll 1148443c5fcSchristos@item -ma2 1158443c5fcSchristosGenerate code for A2 architecture. 1168443c5fcSchristos 1172a6b7db3Sskrll@item -me300 1182a6b7db3SskrllGenerate code for PowerPC e300 family. 1192a6b7db3Sskrll 1202a6b7db3Sskrll@item -maltivec 1212a6b7db3SskrllGenerate code for processors with AltiVec instructions. 1222a6b7db3Sskrll 123438aacb6Schristos@item -mvle 124438aacb6SchristosGenerate code for Freescale PowerPC VLE instructions. 125438aacb6Schristos 1262a6b7db3Sskrll@item -mvsx 1272a6b7db3SskrllGenerate code for processors with Vector-Scalar (VSX) instructions. 1282a6b7db3Sskrll 129438aacb6Schristos@item -mhtm 130438aacb6SchristosGenerate code for processors with Hardware Transactional Memory instructions. 131438aacb6Schristos 1328443c5fcSchristos@item -mpower4, -mpwr4 1332a6b7db3SskrllGenerate code for Power4 architecture. 1342a6b7db3Sskrll 1358443c5fcSchristos@item -mpower5, -mpwr5, -mpwr5x 1362a6b7db3SskrllGenerate code for Power5 architecture. 1372a6b7db3Sskrll 1388443c5fcSchristos@item -mpower6, -mpwr6 1392a6b7db3SskrllGenerate code for Power6 architecture. 1402a6b7db3Sskrll 1418443c5fcSchristos@item -mpower7, -mpwr7 1422a6b7db3SskrllGenerate code for Power7 architecture. 1432a6b7db3Sskrll 144438aacb6Schristos@item -mpower8, -mpwr8 145438aacb6SchristosGenerate code for Power8 architecture. 146438aacb6Schristos 147438aacb6Schristos@item -mpower9, -mpwr9 148438aacb6SchristosGenerate code for Power9 architecture. 149438aacb6Schristos 150*e072ec67Schristos@item -mpower10, -mpwr10 151*e072ec67SchristosGenerate code for Power10 architecture. 152*e072ec67Schristos 153438aacb6Schristos@item -mcell 1542a6b7db3Sskrll@item -mcell 1552a6b7db3SskrllGenerate code for Cell Broadband Engine architecture. 1562a6b7db3Sskrll 1572a6b7db3Sskrll@item -mcom 1582a6b7db3SskrllGenerate code Power/PowerPC common instructions. 1592a6b7db3Sskrll 1602a6b7db3Sskrll@item -many 1612a6b7db3SskrllGenerate code for any architecture (PWR/PWRX/PPC). 1622a6b7db3Sskrll 1632a6b7db3Sskrll@item -mregnames 1642a6b7db3SskrllAllow symbolic names for registers. 1652a6b7db3Sskrll 1662a6b7db3Sskrll@item -mno-regnames 1672a6b7db3SskrllDo not allow symbolic names for registers. 1682a6b7db3Sskrll 1692a6b7db3Sskrll@item -mrelocatable 1702a6b7db3SskrllSupport for GCC's -mrelocatable option. 1712a6b7db3Sskrll 1722a6b7db3Sskrll@item -mrelocatable-lib 1732a6b7db3SskrllSupport for GCC's -mrelocatable-lib option. 1742a6b7db3Sskrll 1752a6b7db3Sskrll@item -memb 1762a6b7db3SskrllSet PPC_EMB bit in ELF flags. 1772a6b7db3Sskrll 1788443c5fcSchristos@item -mlittle, -mlittle-endian, -le 1792a6b7db3SskrllGenerate code for a little endian machine. 1802a6b7db3Sskrll 1818443c5fcSchristos@item -mbig, -mbig-endian, -be 1822a6b7db3SskrllGenerate code for a big endian machine. 1832a6b7db3Sskrll 1842a6b7db3Sskrll@item -msolaris 1852a6b7db3SskrllGenerate code for Solaris. 1862a6b7db3Sskrll 1872a6b7db3Sskrll@item -mno-solaris 1882a6b7db3SskrllDo not generate code for Solaris. 1898443c5fcSchristos 1908443c5fcSchristos@item -nops=@var{count} 1918443c5fcSchristosIf an alignment directive inserts more than @var{count} nops, put a 1928443c5fcSchristosbranch at the beginning to skip execution of the nops. 1932a6b7db3Sskrll@end table 1944c43201bSchristos@c man end 1952a6b7db3Sskrll 1962a6b7db3Sskrll 1972a6b7db3Sskrll@node PowerPC-Pseudo 1982a6b7db3Sskrll@section PowerPC Assembler Directives 1992a6b7db3Sskrll 2002a6b7db3Sskrll@cindex directives for PowerPC 2012a6b7db3Sskrll@cindex PowerPC directives 2022a6b7db3SskrllA number of assembler directives are available for PowerPC. The 2032a6b7db3Sskrllfollowing table is far from complete. 2042a6b7db3Sskrll 2052a6b7db3Sskrll@table @code 2062a6b7db3Sskrll@item .machine "string" 2072a6b7db3SskrllThis directive allows you to change the machine for which code is 2082a6b7db3Sskrllgenerated. @code{"string"} may be any of the -m cpu selection options 2092a6b7db3Sskrll(without the -m) enclosed in double quotes, @code{"push"}, or 2102a6b7db3Sskrll@code{"pop"}. @code{.machine "push"} saves the currently selected 2112a6b7db3Sskrllcpu, which may be restored with @code{.machine "pop"}. 2122a6b7db3Sskrll@end table 2134c43201bSchristos 2144c43201bSchristos@node PowerPC-Syntax 2154c43201bSchristos@section PowerPC Syntax 2164c43201bSchristos@menu 2174c43201bSchristos* PowerPC-Chars:: Special Characters 2184c43201bSchristos@end menu 2194c43201bSchristos 2204c43201bSchristos@node PowerPC-Chars 2214c43201bSchristos@subsection Special Characters 2224c43201bSchristos 2234c43201bSchristos@cindex line comment character, PowerPC 2244c43201bSchristos@cindex PowerPC line comment character 2254c43201bSchristosThe presence of a @samp{#} on a line indicates the start of a comment 2264c43201bSchristosthat extends to the end of the current line. 2274c43201bSchristos 2284c43201bSchristosIf a @samp{#} appears as the first character of a line then the whole 2294c43201bSchristosline is treated as a comment, but in this case the line could also be 2304c43201bSchristosa logical line number directive (@pxref{Comments}) or a preprocessor 2314c43201bSchristoscontrol command (@pxref{Preprocessing}). 2324c43201bSchristos 2334c43201bSchristosIf the assembler has been configured for the ppc-*-solaris* target 2344c43201bSchristosthen the @samp{!} character also acts as a line comment character. 235c21fdd85SchristosThis can be disabled via the @option{-mno-solaris} command-line 2364c43201bSchristosoption. 2374c43201bSchristos 2384c43201bSchristos@cindex line separator, PowerPC 2394c43201bSchristos@cindex statement separator, PowerPC 2404c43201bSchristos@cindex PowerPC line separator 2414c43201bSchristosThe @samp{;} character can be used to separate statements on the same 2424c43201bSchristosline. 243