Home | History | Annotate | Line # | Download | only in doc
c-ppc.texi revision 1.1.1.12
      1  1.1.1.12  christos @c Copyright (C) 2001-2026 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.1.10  christos @item -me200z2, -me200z4
     85  1.1.1.10  christos Generate code for e200 variants, e200z2 with LSP, e200z4 with SPE.
     86  1.1.1.10  christos 
     87  1.1.1.10  christos @item -me300
     88  1.1.1.10  christos Generate code for PowerPC e300 family.
     89  1.1.1.10  christos 
     90       1.1     skrll @item -me500, -me500x2
     91       1.1     skrll Generate code for Motorola e500 core complex.
     92       1.1     skrll 
     93   1.1.1.3  christos @item -me500mc
     94   1.1.1.3  christos Generate code for Freescale e500mc core complex.
     95   1.1.1.3  christos 
     96   1.1.1.3  christos @item -me500mc64
     97   1.1.1.3  christos Generate code for Freescale e500mc64 core complex.
     98   1.1.1.3  christos 
     99   1.1.1.4  christos @item -me5500
    100   1.1.1.4  christos Generate code for Freescale e5500 core complex.
    101   1.1.1.4  christos 
    102   1.1.1.4  christos @item -me6500
    103   1.1.1.4  christos Generate code for Freescale e6500 core complex.
    104   1.1.1.4  christos 
    105  1.1.1.10  christos @item -mlsp
    106  1.1.1.10  christos Enable LSP instructions.  (Disables SPE and SPE2.)
    107  1.1.1.10  christos 
    108       1.1     skrll @item -mspe
    109  1.1.1.10  christos Generate code for Motorola SPE instructions.  (Disables LSP.)
    110       1.1     skrll 
    111   1.1.1.7  christos @item -mspe2
    112  1.1.1.10  christos Generate code for Freescale SPE2 instructions.  (Disables LSP.)
    113   1.1.1.7  christos 
    114   1.1.1.3  christos @item -mtitan
    115   1.1.1.3  christos Generate code for AppliedMicro Titan core complex.
    116   1.1.1.3  christos 
    117       1.1     skrll @item -mppc64bridge
    118       1.1     skrll Generate code for PowerPC 64, including bridge insns.
    119       1.1     skrll 
    120   1.1.1.2     skrll @item -mbooke
    121       1.1     skrll Generate code for 32-bit BookE.
    122       1.1     skrll 
    123   1.1.1.3  christos @item -ma2
    124   1.1.1.3  christos Generate code for A2 architecture.
    125   1.1.1.3  christos 
    126       1.1     skrll @item -maltivec
    127       1.1     skrll Generate code for processors with AltiVec instructions.
    128       1.1     skrll 
    129   1.1.1.5  christos @item -mvle
    130   1.1.1.5  christos Generate code for Freescale PowerPC VLE instructions.
    131   1.1.1.5  christos 
    132       1.1     skrll @item -mvsx
    133       1.1     skrll Generate code for processors with Vector-Scalar (VSX) instructions.
    134       1.1     skrll 
    135   1.1.1.5  christos @item -mhtm
    136   1.1.1.5  christos Generate code for processors with Hardware Transactional Memory instructions.
    137   1.1.1.5  christos 
    138   1.1.1.3  christos @item -mpower4, -mpwr4
    139       1.1     skrll Generate code for Power4 architecture.
    140       1.1     skrll 
    141   1.1.1.3  christos @item -mpower5, -mpwr5, -mpwr5x
    142       1.1     skrll Generate code for Power5 architecture.
    143       1.1     skrll 
    144   1.1.1.3  christos @item -mpower6, -mpwr6
    145       1.1     skrll Generate code for Power6 architecture.
    146       1.1     skrll 
    147   1.1.1.3  christos @item -mpower7, -mpwr7
    148       1.1     skrll Generate code for Power7 architecture.
    149       1.1     skrll 
    150   1.1.1.5  christos @item -mpower8, -mpwr8
    151   1.1.1.5  christos Generate code for Power8 architecture.
    152   1.1.1.5  christos 
    153   1.1.1.5  christos @item -mpower9, -mpwr9
    154   1.1.1.5  christos Generate code for Power9 architecture.
    155   1.1.1.5  christos 
    156   1.1.1.9  christos @item -mpower10, -mpwr10
    157   1.1.1.9  christos Generate code for Power10 architecture.
    158   1.1.1.9  christos 
    159  1.1.1.11  christos @item -mpower11, -mpwr11
    160  1.1.1.11  christos Generate code for Power11 architecture.
    161  1.1.1.11  christos 
    162  1.1.1.10  christos @item -mfuture
    163  1.1.1.10  christos Generate code for 'future' architecture.
    164  1.1.1.10  christos 
    165   1.1.1.5  christos @item -mcell
    166       1.1     skrll @item -mcell
    167       1.1     skrll Generate code for Cell Broadband Engine architecture.
    168       1.1     skrll 
    169       1.1     skrll @item -mcom
    170       1.1     skrll Generate code Power/PowerPC common instructions.
    171       1.1     skrll 
    172       1.1     skrll @item -many
    173       1.1     skrll Generate code for any architecture (PWR/PWRX/PPC).
    174       1.1     skrll 
    175       1.1     skrll @item -mregnames
    176       1.1     skrll Allow symbolic names for registers.
    177       1.1     skrll 
    178       1.1     skrll @item -mno-regnames
    179       1.1     skrll Do not allow symbolic names for registers.
    180       1.1     skrll 
    181       1.1     skrll @item -mrelocatable
    182       1.1     skrll Support for GCC's -mrelocatable option.
    183       1.1     skrll 
    184       1.1     skrll @item -mrelocatable-lib
    185       1.1     skrll Support for GCC's -mrelocatable-lib option.
    186       1.1     skrll 
    187       1.1     skrll @item -memb
    188       1.1     skrll Set PPC_EMB bit in ELF flags.
    189       1.1     skrll 
    190   1.1.1.3  christos @item -mlittle, -mlittle-endian, -le
    191       1.1     skrll Generate code for a little endian machine.
    192       1.1     skrll 
    193   1.1.1.3  christos @item -mbig, -mbig-endian, -be
    194       1.1     skrll Generate code for a big endian machine.
    195       1.1     skrll 
    196   1.1.1.3  christos @item -nops=@var{count}
    197   1.1.1.3  christos If an alignment directive inserts more than @var{count} nops, put a
    198   1.1.1.3  christos branch at the beginning to skip execution of the nops.
    199       1.1     skrll @end table
    200   1.1.1.4  christos @c man end
    201       1.1     skrll 
    202       1.1     skrll 
    203       1.1     skrll @node PowerPC-Pseudo
    204       1.1     skrll @section PowerPC Assembler Directives
    205       1.1     skrll 
    206       1.1     skrll @cindex directives for PowerPC
    207       1.1     skrll @cindex PowerPC directives
    208       1.1     skrll A number of assembler directives are available for PowerPC.  The
    209       1.1     skrll following table is far from complete.
    210       1.1     skrll 
    211       1.1     skrll @table @code
    212       1.1     skrll @item .machine "string"
    213       1.1     skrll This directive allows you to change the machine for which code is
    214       1.1     skrll generated.  @code{"string"} may be any of the -m cpu selection options
    215       1.1     skrll (without the -m) enclosed in double quotes, @code{"push"}, or
    216       1.1     skrll @code{"pop"}.  @code{.machine "push"} saves the currently selected
    217       1.1     skrll cpu, which may be restored with @code{.machine "pop"}.
    218       1.1     skrll @end table
    219   1.1.1.4  christos 
    220   1.1.1.4  christos @node PowerPC-Syntax
    221   1.1.1.4  christos @section PowerPC Syntax
    222   1.1.1.4  christos @menu
    223   1.1.1.4  christos * PowerPC-Chars::                Special Characters
    224   1.1.1.4  christos @end menu
    225   1.1.1.4  christos 
    226   1.1.1.4  christos @node PowerPC-Chars
    227   1.1.1.4  christos @subsection Special Characters
    228   1.1.1.4  christos 
    229   1.1.1.4  christos @cindex line comment character, PowerPC
    230   1.1.1.4  christos @cindex PowerPC line comment character
    231   1.1.1.4  christos The presence of a @samp{#} on a line indicates the start of a comment
    232   1.1.1.4  christos that extends to the end of the current line.
    233   1.1.1.4  christos 
    234   1.1.1.4  christos If a @samp{#} appears as the first character of a line then the whole
    235   1.1.1.4  christos line is treated as a comment, but in this case the line could also be
    236   1.1.1.4  christos a logical line number directive (@pxref{Comments}) or a preprocessor
    237   1.1.1.4  christos control command (@pxref{Preprocessing}).
    238   1.1.1.4  christos 
    239   1.1.1.4  christos @cindex line separator, PowerPC
    240   1.1.1.4  christos @cindex statement separator, PowerPC
    241   1.1.1.4  christos @cindex PowerPC line separator
    242   1.1.1.4  christos The @samp{;} character can be used to separate statements on the same
    243   1.1.1.4  christos line.
    244