old-cross-binutils/gas/doc/c-alpha.texi

488 lines
17 KiB
Text
Raw Normal View History

PR gas/12390 * doc/all.texi: Add NS32K * doc/as.texinfo: Remove target specific details of which characters act as comment initiators and statement separators into individual target specific files. * doc/c-alpha.texi (Alpha-Chars): Document special behaviour of the hash character at the start of a line. * doc/c-arm.texi (ARM-Chars): Likewise. * doc/c-avr.texi (AVR-Chars): Likewise. * doc/c-d10v.texi (D10V-Chars): Likewise. * doc/c-d30v.texi (D30V-Chars): Likewise. * doc/c-mmix.texi (MMIX-Chars): Likewise. * doc/c-s390.texi (s390 characters): Likewise. * doc/c-sh.texi (SH-Chars): Likewise. * doc/c-sh64.texi (SH64-Chars): Likewise. * doc/c-sparc.texi (SPARC-Chars): Likewise. * doc/c-tic6x.texi (TIC6X Syntax): Likewise. * doc/c-xtensa.texi (Xtensa Syntax): Likewise. * doc/c-z80.texi (Z80-Chars): Likewise. * doc/c-z8k.texi (Z8000-Chars): Likewise. * doc/c-pdp11.texi (PDP11-Syntax): Document line separator character. * doc/c-arc.texi (ARC-Chars): Fill in this subsection. * doc/c-bfin.texi (Blackfin Syntax): Document line comment and line separator characters. * doc/c-cr16.texi (CR16 Syntax): Likewise. * doc/c-i386.texi (i386-Chars): Likewise. * doc/c-i860.texi (i860-Chars): Likewise. * doc/c-i960.texi (i960-Chars): Likewise. * doc/c-ip2k.texi (IP2K-Chars): Likewise. * doc/c-lm32.texi (LM32-Chars): likewise. * doc/c-m32c.texi (M32C-Chars): Likewise. * doc/c-m68hc11.texi (M68HC11-syntax): Likewise. * doc/c-m68k.texi (M68K-Chars): Likewise. * doc/c-microblaze.texi (MicroBlaze-Chars): Likewise. * doc/c-msp430.texi (MSP430-Chars): Likewise. * doc/c-mt.texi (MT-Chars): Likewise. * doc/c-ns32k.texi (NS32K-Chars): Likewise. * doc/c-pj.texi (PJ-Chars): Likewise. * doc/c-ppc.texi (PowerPC-Chars): Likewise. * doc/c-rx.texi (RX-Chars): Likewise. * doc/c-score.texi (SCORE-Chars): Likewise. * doc/c-tic54x.texi (TIC54X-Chars): Likewise. * doc/c-v850.texi (V850-Chars): Likewise. * doc/c-vax.texi (VAX-Chars): Likewise. * doc/c-xc16x.texi (xc16x-Chars): Likewise.
2011-01-18 13:37:39 +00:00
@c Copyright 2002, 2003, 2005, 2009, 2011
@c Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@c man end
@ifset GENERIC
@page
@node Alpha-Dependent
@chapter Alpha Dependent Features
@end ifset
@ifclear GENERIC
@node Machine Dependencies
@chapter Alpha Dependent Features
@end ifclear
@cindex Alpha support
@menu
* Alpha Notes:: Notes
* Alpha Options:: Options
* Alpha Syntax:: Syntax
* Alpha Floating Point:: Floating Point
* Alpha Directives:: Alpha Machine Directives
* Alpha Opcodes:: Opcodes
@end menu
@node Alpha Notes
@section Notes
@cindex Alpha notes
@cindex notes for Alpha
The documentation here is primarily for the ELF object format.
@code{@value{AS}} also supports the ECOFF and EVAX formats, but
features specific to these formats are not yet documented.
@node Alpha Options
@section Options
@cindex Alpha options
@cindex options for Alpha
@c man begin OPTIONS
@table @gcctabopt
@cindex @code{-m@var{cpu}} command line option, Alpha
@item -m@var{cpu}
This option specifies the target processor. If an attempt is made to
assemble an instruction which will not execute on the target processor,
the assembler may either expand the instruction as a macro or issue an
error message. This option is equivalent to the @code{.arch} directive.
The following processor names are recognized:
@code{21064},
@code{21064a},
@code{21066},
@code{21068},
@code{21164},
@code{21164a},
@code{21164pc},
@code{21264},
@code{21264a},
@code{21264b},
@code{ev4},
@code{ev5},
@code{lca45},
@code{ev5},
@code{ev56},
@code{pca56},
@code{ev6},
@code{ev67},
@code{ev68}.
The special name @code{all} may be used to allow the assembler to accept
instructions valid for any Alpha processor.
In order to support existing practice in OSF/1 with respect to @code{.arch},
and existing practice within @command{MILO} (the Linux ARC bootloader), the
numbered processor names (e.g.@: 21064) enable the processor-specific PALcode
instructions, while the ``electro-vlasic'' names (e.g.@: @code{ev4}) do not.
@cindex @code{-mdebug} command line option, Alpha
@cindex @code{-no-mdebug} command line option, Alpha
@item -mdebug
@itemx -no-mdebug
Enables or disables the generation of @code{.mdebug} encapsulation for
stabs directives and procedure descriptors. The default is to automatically
enable @code{.mdebug} when the first stabs directive is seen.
@cindex @code{-relax} command line option, Alpha
@item -relax
This option forces all relocations to be put into the object file, instead
of saving space and resolving some relocations at assembly time. Note that
this option does not propagate all symbol arithmetic into the object file,
because not all symbol arithmetic can be represented. However, the option
can still be useful in specific applications.
2009-03-03 Tristan Gingold <gingold@adacore.com> Eric Botcazou <ebotcazou@adacore.com> Douglas B Rupp <rupp@gnat.com> * doc/as.texinfo (Overview): Mention -replace/-noreplace options for Alpha. * doc/c-alpha.texi (Alpha Options): Document -replace/-noreplace. * config/tc-alpha.h (TC_VALIDATE_FIX_SUB): Define to 1 (evax). (OBJ_SYMFIELD_TYPE): Remove. (tc_canonicalize_symbol_name): Define to evax_shorten_name. (TC_IMPLICIT_LCOMM_ALIGNMENT): For alignment to 3 on evax. (tc_frob_file_before_fix): Do not defined on evax. * config/tc-alpha.c: Always includes dwarf2dbg.h. Include vms.h if OBJ_EVAX. (struct alpha_fixup): Add xtrasym and procsym (evax only). (enum alpha_macro_arg): Remove trailing comma. (md_longopts): Add replace and noreplace arguments (evax only). (alpha_evax_proc_hash): New variable. (alpha_link_section): Make it global. (alpha_ctors_section, alpha_dtors_section): Removed. (alpha_ctors_symbol, alpha_dtors_symbol): Ditto. (alpha_lit8_section): Ifndef'ed on evax. (alpha_lit8_symbol): Ditto. (alpha_prologue_label): New variable. (alpha_linkage_symbol): New variable (evax only). (alpha_flag_replace): Ditto. (struct alpha_evax_procs): Add handler and handler_data field. (alpha_evax_proc): Now of type pointer. (alpha_linkage_fixup_root, alpha_linkage_fixup_tail): New variables. (struct alpha_reloc_tag): Add sym and psym fields (evax only). (get_alpha_reloc_tag): Initialize sym and psym fields (evax only). (alpha_adjust_relocs): Ifndef'ed on evax. (load_expression): Add opname argument. Implement LDA/BSR optimization for evax. (emit_lda): Adjust for new prototype of load_expression. (emit_ir_load): Ditto. Do not nothing for GP if ..lk symbols. (emit_loadstore): Likewise. (emit_ldXu): Likewise. (emit_stX): Likewise. (emit_jsrjmp): Likewise. Implement LDA/BSR optimization for evax. (emit_ldgp): Avoid warning in evax case. (add_to_link_pool): Make it static. Return symbolic expression rather than number expression for the offset. (s_alpha_text): Create .text symbol for evax if not already created. (s_alpha_comm): Do not create specific section for common symbol. Fill common area with zeros for evax. (s_alpha_prologue): Create alpha_prologue_label. (s_alpha_section_name): New function (evax). (s_alpha_section_word): Likewise. (section_name): New static variabke moved out from ... (s_alpha_section): ... here. Create new sections on demand. (s_alpha_literals): New function (evax). (s_alpha_ent): Create alpha_evax_proc instance and insert it in the alpha_evax_proc_hash table. (s_alpha_handler): New function (evax). (s_alpha_frame): Adjust for new type of alpha_evax_proc. (s_alpha_prologue): New function (evax). (s_alpha_pdesc): Adjust for new type of alpha_evax_proc and new handling of procedures with hash table. Add support for condition handlers. (s_alpha_linkage): Create linkage_fixup instance and chain it. (s_alpha_fp_save): Adjust for new type of alpha_evax_proc. (s_alpha_mask): Likewise. (s_alpha_fmask): Likewise. (s_alpha_end): Clear alpha_evax_proc. (s_alpha_align): Increase max_alignment to 16. (alpha_print_token): Call print_expr_1 instead of print_expr. (md_pseudo_table): Add "section", "literals", "handler" and "handler_data" (evax). Do not ignore "prologue" on evax. Fix indentation. (md_begin): Create hash table for alpha_evax_proc_hash. (md_parse_option): Handle OPTION_REPLACE and OPTION_NOREPLACE. (md_show_usage): Mention -replace/-noreplace for evax. (md_apply_fix): Handle evax relocs (_NOP, _LDA, _BSR and _BOH). (alpha_force_relocation): Likewise. (alpha_fix_adjustable): Likewise. Add BFD_RELOC_16 case. (tc_gen_reloc): Likewise. Add BFD_RELOC_ALPHA_LINKAGE for evax. (emit_insn): New cases for evax specific relocs. (assemble_insn): Fix indentation. Take care of -MDISP in operand table. * config/obj-evax.h (struct alpha_linkage_fixups): New struct. (OBJ_SYMFIELD_TYPE): New macro. (obj_symbol_new_hook): Define. (obj_frob_symbol, obj_frob_file_before_adjust): Ditto. (obj_frob_file_before_fix): Ditto. (PDSC_S_M_HANDLER_VALID): New macro. (PDSC_S_M_HANDLER_DATA_VALID): Ditto. (TC_IMPLICIT_LCOMM_ALIGNMENT): Remove. Add prototypes for functions declared in obj-evax.c * config/obj-evax.c: Include subsegs.h, struc-symbol.h, safe-ctype.h. (s_evax_weak): Convert to ansi-C. (evax_symbol_new_hook): New function. (evax_frob_symbol): Ditto. (evax_frob_file_before_adjust): Ditto. (evax_frob_file_before_fix): Ditto. (evax_shorten_name): Ditto. (crc32): Ditto. (encode_32): Ditto. (encode_16): Ditto. (decode_16): Ditto. (shorten_identifier): Ditto. (is_truncated_identifier): Ditto. * dwarf2dbg.c (out_debug_info): Do not append trailing slash on VMS. * as.c (close_output_file): Remove #ifndef OBJ_VMS. (main): Ditto.
2009-03-03 10:04:58 +00:00
@cindex @code{-replace} command line option, Alpha
@cindex @code{-noreplace} command line option, Alpha
@item -replace
@itemx -noreplace
2009-03-03 Tristan Gingold <gingold@adacore.com> Eric Botcazou <ebotcazou@adacore.com> Douglas B Rupp <rupp@gnat.com> * doc/as.texinfo (Overview): Mention -replace/-noreplace options for Alpha. * doc/c-alpha.texi (Alpha Options): Document -replace/-noreplace. * config/tc-alpha.h (TC_VALIDATE_FIX_SUB): Define to 1 (evax). (OBJ_SYMFIELD_TYPE): Remove. (tc_canonicalize_symbol_name): Define to evax_shorten_name. (TC_IMPLICIT_LCOMM_ALIGNMENT): For alignment to 3 on evax. (tc_frob_file_before_fix): Do not defined on evax. * config/tc-alpha.c: Always includes dwarf2dbg.h. Include vms.h if OBJ_EVAX. (struct alpha_fixup): Add xtrasym and procsym (evax only). (enum alpha_macro_arg): Remove trailing comma. (md_longopts): Add replace and noreplace arguments (evax only). (alpha_evax_proc_hash): New variable. (alpha_link_section): Make it global. (alpha_ctors_section, alpha_dtors_section): Removed. (alpha_ctors_symbol, alpha_dtors_symbol): Ditto. (alpha_lit8_section): Ifndef'ed on evax. (alpha_lit8_symbol): Ditto. (alpha_prologue_label): New variable. (alpha_linkage_symbol): New variable (evax only). (alpha_flag_replace): Ditto. (struct alpha_evax_procs): Add handler and handler_data field. (alpha_evax_proc): Now of type pointer. (alpha_linkage_fixup_root, alpha_linkage_fixup_tail): New variables. (struct alpha_reloc_tag): Add sym and psym fields (evax only). (get_alpha_reloc_tag): Initialize sym and psym fields (evax only). (alpha_adjust_relocs): Ifndef'ed on evax. (load_expression): Add opname argument. Implement LDA/BSR optimization for evax. (emit_lda): Adjust for new prototype of load_expression. (emit_ir_load): Ditto. Do not nothing for GP if ..lk symbols. (emit_loadstore): Likewise. (emit_ldXu): Likewise. (emit_stX): Likewise. (emit_jsrjmp): Likewise. Implement LDA/BSR optimization for evax. (emit_ldgp): Avoid warning in evax case. (add_to_link_pool): Make it static. Return symbolic expression rather than number expression for the offset. (s_alpha_text): Create .text symbol for evax if not already created. (s_alpha_comm): Do not create specific section for common symbol. Fill common area with zeros for evax. (s_alpha_prologue): Create alpha_prologue_label. (s_alpha_section_name): New function (evax). (s_alpha_section_word): Likewise. (section_name): New static variabke moved out from ... (s_alpha_section): ... here. Create new sections on demand. (s_alpha_literals): New function (evax). (s_alpha_ent): Create alpha_evax_proc instance and insert it in the alpha_evax_proc_hash table. (s_alpha_handler): New function (evax). (s_alpha_frame): Adjust for new type of alpha_evax_proc. (s_alpha_prologue): New function (evax). (s_alpha_pdesc): Adjust for new type of alpha_evax_proc and new handling of procedures with hash table. Add support for condition handlers. (s_alpha_linkage): Create linkage_fixup instance and chain it. (s_alpha_fp_save): Adjust for new type of alpha_evax_proc. (s_alpha_mask): Likewise. (s_alpha_fmask): Likewise. (s_alpha_end): Clear alpha_evax_proc. (s_alpha_align): Increase max_alignment to 16. (alpha_print_token): Call print_expr_1 instead of print_expr. (md_pseudo_table): Add "section", "literals", "handler" and "handler_data" (evax). Do not ignore "prologue" on evax. Fix indentation. (md_begin): Create hash table for alpha_evax_proc_hash. (md_parse_option): Handle OPTION_REPLACE and OPTION_NOREPLACE. (md_show_usage): Mention -replace/-noreplace for evax. (md_apply_fix): Handle evax relocs (_NOP, _LDA, _BSR and _BOH). (alpha_force_relocation): Likewise. (alpha_fix_adjustable): Likewise. Add BFD_RELOC_16 case. (tc_gen_reloc): Likewise. Add BFD_RELOC_ALPHA_LINKAGE for evax. (emit_insn): New cases for evax specific relocs. (assemble_insn): Fix indentation. Take care of -MDISP in operand table. * config/obj-evax.h (struct alpha_linkage_fixups): New struct. (OBJ_SYMFIELD_TYPE): New macro. (obj_symbol_new_hook): Define. (obj_frob_symbol, obj_frob_file_before_adjust): Ditto. (obj_frob_file_before_fix): Ditto. (PDSC_S_M_HANDLER_VALID): New macro. (PDSC_S_M_HANDLER_DATA_VALID): Ditto. (TC_IMPLICIT_LCOMM_ALIGNMENT): Remove. Add prototypes for functions declared in obj-evax.c * config/obj-evax.c: Include subsegs.h, struc-symbol.h, safe-ctype.h. (s_evax_weak): Convert to ansi-C. (evax_symbol_new_hook): New function. (evax_frob_symbol): Ditto. (evax_frob_file_before_adjust): Ditto. (evax_frob_file_before_fix): Ditto. (evax_shorten_name): Ditto. (crc32): Ditto. (encode_32): Ditto. (encode_16): Ditto. (decode_16): Ditto. (shorten_identifier): Ditto. (is_truncated_identifier): Ditto. * dwarf2dbg.c (out_debug_info): Do not append trailing slash on VMS. * as.c (close_output_file): Remove #ifndef OBJ_VMS. (main): Ditto.
2009-03-03 10:04:58 +00:00
Enables or disables the optimization of procedure calls, both at assemblage
and at link time. These options are only available for VMS targets and
@code{-replace} is the default. See section 1.4.1 of the OpenVMS Linker
Utility Manual.
@cindex @code{-g} command line option, Alpha
@item -g
This option is used when the compiler generates debug information. When
@command{gcc} is using @command{mips-tfile} to generate debug
information for ECOFF, local labels must be passed through to the object
file. Otherwise this option has no effect.
@cindex @code{-G} command line option, Alpha
@item -G@var{size}
A local common symbol larger than @var{size} is placed in @code{.bss},
while smaller symbols are placed in @code{.sbss}.
@cindex @code{-F} command line option, Alpha
@cindex @code{-32addr} command line option, Alpha
@item -F
@itemx -32addr
These options are ignored for backward compatibility.
@end table
@c man end
@cindex Alpha Syntax
@node Alpha Syntax
@section Syntax
The assembler syntax closely follow the Alpha Reference Manual;
assembler directives and general syntax closely follow the OSF/1 and
OpenVMS syntax, with a few differences for ELF.
@menu
* Alpha-Chars:: Special Characters
* Alpha-Regs:: Register Names
* Alpha-Relocs:: Relocations
@end menu
@node Alpha-Chars
@subsection Special Characters
@cindex line comment character, Alpha
@cindex Alpha line comment character
PR gas/12390 * doc/all.texi: Add NS32K * doc/as.texinfo: Remove target specific details of which characters act as comment initiators and statement separators into individual target specific files. * doc/c-alpha.texi (Alpha-Chars): Document special behaviour of the hash character at the start of a line. * doc/c-arm.texi (ARM-Chars): Likewise. * doc/c-avr.texi (AVR-Chars): Likewise. * doc/c-d10v.texi (D10V-Chars): Likewise. * doc/c-d30v.texi (D30V-Chars): Likewise. * doc/c-mmix.texi (MMIX-Chars): Likewise. * doc/c-s390.texi (s390 characters): Likewise. * doc/c-sh.texi (SH-Chars): Likewise. * doc/c-sh64.texi (SH64-Chars): Likewise. * doc/c-sparc.texi (SPARC-Chars): Likewise. * doc/c-tic6x.texi (TIC6X Syntax): Likewise. * doc/c-xtensa.texi (Xtensa Syntax): Likewise. * doc/c-z80.texi (Z80-Chars): Likewise. * doc/c-z8k.texi (Z8000-Chars): Likewise. * doc/c-pdp11.texi (PDP11-Syntax): Document line separator character. * doc/c-arc.texi (ARC-Chars): Fill in this subsection. * doc/c-bfin.texi (Blackfin Syntax): Document line comment and line separator characters. * doc/c-cr16.texi (CR16 Syntax): Likewise. * doc/c-i386.texi (i386-Chars): Likewise. * doc/c-i860.texi (i860-Chars): Likewise. * doc/c-i960.texi (i960-Chars): Likewise. * doc/c-ip2k.texi (IP2K-Chars): Likewise. * doc/c-lm32.texi (LM32-Chars): likewise. * doc/c-m32c.texi (M32C-Chars): Likewise. * doc/c-m68hc11.texi (M68HC11-syntax): Likewise. * doc/c-m68k.texi (M68K-Chars): Likewise. * doc/c-microblaze.texi (MicroBlaze-Chars): Likewise. * doc/c-msp430.texi (MSP430-Chars): Likewise. * doc/c-mt.texi (MT-Chars): Likewise. * doc/c-ns32k.texi (NS32K-Chars): Likewise. * doc/c-pj.texi (PJ-Chars): Likewise. * doc/c-ppc.texi (PowerPC-Chars): Likewise. * doc/c-rx.texi (RX-Chars): Likewise. * doc/c-score.texi (SCORE-Chars): Likewise. * doc/c-tic54x.texi (TIC54X-Chars): Likewise. * doc/c-v850.texi (V850-Chars): Likewise. * doc/c-vax.texi (VAX-Chars): Likewise. * doc/c-xc16x.texi (xc16x-Chars): Likewise.
2011-01-18 13:37:39 +00:00
@samp{#} is the line comment character. Note that if @samp{#} is the
first character on a line then it can also be a logical line number
directive (@pxref{Comments}) or a preprocessor control
command (@pxref{Preprocessing}).
@cindex line separator, Alpha
@cindex statement separator, Alpha
@cindex Alpha line separator
@samp{;} can be used instead of a newline to separate statements.
@node Alpha-Regs
@subsection Register Names
@cindex Alpha registers
@cindex register names, Alpha
The 32 integer registers are referred to as @samp{$@var{n}} or
@samp{$r@var{n}}. In addition, registers 15, 28, 29, and 30 may
be referred to by the symbols @samp{$fp}, @samp{$at}, @samp{$gp},
and @samp{$sp} respectively.
The 32 floating-point registers are referred to as @samp{$f@var{n}}.
@node Alpha-Relocs
@subsection Relocations
@cindex Alpha relocations
@cindex relocations, Alpha
Some of these relocations are available for ECOFF, but mostly
only for ELF. They are modeled after the relocation format
introduced in Digital Unix 4.0, but there are additions.
The format is @samp{!@var{tag}} or @samp{!@var{tag}!@var{number}}
where @var{tag} is the name of the relocation. In some cases
@var{number} is used to relate specific instructions.
The relocation is placed at the end of the instruction like so:
@example
ldah $0,a($29) !gprelhigh
lda $0,a($0) !gprellow
ldq $1,b($29) !literal!100
ldl $2,0($1) !lituse_base!100
@end example
@table @code
@item !literal
@itemx !literal!@var{N}
Used with an @code{ldq} instruction to load the address of a symbol
from the GOT.
A sequence number @var{N} is optional, and if present is used to pair
@code{lituse} relocations with this @code{literal} relocation. The
@code{lituse} relocations are used by the linker to optimize the code
based on the final location of the symbol.
Note that these optimizations are dependent on the data flow of the
program. Therefore, if @emph{any} @code{lituse} is paired with a
@code{literal} relocation, then @emph{all} uses of the register set by
the @code{literal} instruction must also be marked with @code{lituse}
relocations. This is because the original @code{literal} instruction
may be deleted or transformed into another instruction.
Also note that there may be a one-to-many relationship between
@code{literal} and @code{lituse}, but not a many-to-one. That is, if
there are two code paths that load up the same address and feed the
value to a single use, then the use may not use a @code{lituse}
relocation.
@item !lituse_base!@var{N}
Used with any memory format instruction (e.g.@: @code{ldl}) to indicate
that the literal is used for an address load. The offset field of the
instruction must be zero. During relaxation, the code may be altered
to use a gp-relative load.
@item !lituse_jsr!@var{N}
Used with a register branch format instruction (e.g.@: @code{jsr}) to
indicate that the literal is used for a call. During relaxation, the
code may be altered to use a direct branch (e.g.@: @code{bsr}).
@item !lituse_jsrdirect!@var{N}
Similar to @code{lituse_jsr}, but also that this call cannot be vectored
through a PLT entry. This is useful for functions with special calling
conventions which do not allow the normal call-clobbered registers to be
clobbered.
@item !lituse_bytoff!@var{N}
Used with a byte mask instruction (e.g.@: @code{extbl}) to indicate
that only the low 3 bits of the address are relevant. During relaxation,
the code may be altered to use an immediate instead of a register shift.
@item !lituse_addr!@var{N}
Used with any other instruction to indicate that the original address
is in fact used, and the original @code{ldq} instruction may not be
altered or deleted. This is useful in conjunction with @code{lituse_jsr}
to test whether a weak symbol is defined.
@example
ldq $27,foo($29) !literal!1
beq $27,is_undef !lituse_addr!1
jsr $26,($27),foo !lituse_jsr!1
@end example
@item !lituse_tlsgd!@var{N}
Used with a register branch format instruction to indicate that the
literal is the call to @code{__tls_get_addr} used to compute the
address of the thread-local storage variable whose descriptor was
loaded with @code{!tlsgd!@var{N}}.
@item !lituse_tlsldm!@var{N}
Used with a register branch format instruction to indicate that the
literal is the call to @code{__tls_get_addr} used to compute the
address of the base of the thread-local storage block for the current
module. The descriptor for the module must have been loaded with
@code{!tlsldm!@var{N}}.
@item !gpdisp!@var{N}
Used with @code{ldah} and @code{lda} to load the GP from the current
address, a-la the @code{ldgp} macro. The source register for the
@code{ldah} instruction must contain the address of the @code{ldah}
instruction. There must be exactly one @code{lda} instruction paired
with the @code{ldah} instruction, though it may appear anywhere in
the instruction stream. The immediate operands must be zero.
@example
bsr $26,foo
ldah $29,0($26) !gpdisp!1
lda $29,0($29) !gpdisp!1
@end example
@item !gprelhigh
Used with an @code{ldah} instruction to add the high 16 bits of a
32-bit displacement from the GP.
@item !gprellow
Used with any memory format instruction to add the low 16 bits of a
32-bit displacement from the GP.
@item !gprel
Used with any memory format instruction to add a 16-bit displacement
from the GP.
@item !samegp
Used with any branch format instruction to skip the GP load at the
target address. The referenced symbol must have the same GP as the
source object file, and it must be declared to either not use @code{$27}
or perform a standard GP load in the first two instructions via the
@code{.prologue} directive.
@item !tlsgd
@itemx !tlsgd!@var{N}
Used with an @code{lda} instruction to load the address of a TLS
descriptor for a symbol in the GOT.
The sequence number @var{N} is optional, and if present it used to
pair the descriptor load with both the @code{literal} loading the
address of the @code{__tls_get_addr} function and the @code{lituse_tlsgd}
marking the call to that function.
For proper relaxation, both the @code{tlsgd}, @code{literal} and
@code{lituse} relocations must be in the same extended basic block.
That is, the relocation with the lowest address must be executed
first at runtime.
@item !tlsldm
@itemx !tlsldm!@var{N}
Used with an @code{lda} instruction to load the address of a TLS
descriptor for the current module in the GOT.
Similar in other respects to @code{tlsgd}.
@item !gotdtprel
Used with an @code{ldq} instruction to load the offset of the TLS
symbol within its module's thread-local storage block. Also known
as the dynamic thread pointer offset or dtp-relative offset.
@item !dtprelhi
@itemx !dtprello
@itemx !dtprel
Like @code{gprel} relocations except they compute dtp-relative offsets.
@item !gottprel
Used with an @code{ldq} instruction to load the offset of the TLS
symbol from the thread pointer. Also known as the tp-relative offset.
@item !tprelhi
@itemx !tprello
@itemx !tprel
Like @code{gprel} relocations except they compute tp-relative offsets.
@end table
@node Alpha Floating Point
@section Floating Point
@cindex floating point, Alpha (@sc{ieee})
@cindex Alpha floating point (@sc{ieee})
The Alpha family uses both @sc{ieee} and VAX floating-point numbers.
@node Alpha Directives
@section Alpha Assembler Directives
@command{@value{AS}} for the Alpha supports many additional directives for
compatibility with the native assembler. This section describes them only
briefly.
@cindex Alpha-only directives
These are the additional directives in @code{@value{AS}} for the Alpha:
@table @code
@item .arch @var{cpu}
Specifies the target processor. This is equivalent to the
@option{-m@var{cpu}} command-line option. @xref{Alpha Options, Options},
for a list of values for @var{cpu}.
@item .ent @var{function}[, @var{n}]
Mark the beginning of @var{function}. An optional number may follow for
compatibility with the OSF/1 assembler, but is ignored. When generating
@code{.mdebug} information, this will create a procedure descriptor for
the function. In ELF, it will mark the symbol as a function a-la the
generic @code{.type} directive.
@item .end @var{function}
Mark the end of @var{function}. In ELF, it will set the size of the symbol
a-la the generic @code{.size} directive.
@item .mask @var{mask}, @var{offset}
Indicate which of the integer registers are saved in the current
function's stack frame. @var{mask} is interpreted a bit mask in which
bit @var{n} set indicates that register @var{n} is saved. The registers
are saved in a block located @var{offset} bytes from the @dfn{canonical
frame address} (CFA) which is the value of the stack pointer on entry to
the function. The registers are saved sequentially, except that the
return address register (normally @code{$26}) is saved first.
This and the other directives that describe the stack frame are
currently only used when generating @code{.mdebug} information. They
may in the future be used to generate DWARF2 @code{.debug_frame} unwind
information for hand written assembly.
@item .fmask @var{mask}, @var{offset}
Indicate which of the floating-point registers are saved in the current
stack frame. The @var{mask} and @var{offset} parameters are interpreted
as with @code{.mask}.
@item .frame @var{framereg}, @var{frameoffset}, @var{retreg}[, @var{argoffset}]
Describes the shape of the stack frame. The frame pointer in use is
@var{framereg}; normally this is either @code{$fp} or @code{$sp}. The
frame pointer is @var{frameoffset} bytes below the CFA. The return
address is initially located in @var{retreg} until it is saved as
indicated in @code{.mask}. For compatibility with OSF/1 an optional
@var{argoffset} parameter is accepted and ignored. It is believed to
indicate the offset from the CFA to the saved argument registers.
@item .prologue @var{n}
Indicate that the stack frame is set up and all registers have been
spilled. The argument @var{n} indicates whether and how the function
uses the incoming @dfn{procedure vector} (the address of the called
function) in @code{$27}. 0 indicates that @code{$27} is not used; 1
indicates that the first two instructions of the function use @code{$27}
to perform a load of the GP register; 2 indicates that @code{$27} is
used in some non-standard way and so the linker cannot elide the load of
the procedure vector during relaxation.
@item .usepv @var{function}, @var{which}
Used to indicate the use of the @code{$27} register, similar to
@code{.prologue}, but without the other semantics of needing to
be inside an open @code{.ent}/@code{.end} block.
The @var{which} argument should be either @code{no}, indicating that
@code{$27} is not used, or @code{std}, indicating that the first two
instructions of the function perform a GP load.
One might use this directive instead of @code{.prologue} if you are
also using dwarf2 CFI directives.
@item .gprel32 @var{expression}
Computes the difference between the address in @var{expression} and the
GP for the current object file, and stores it in 4 bytes. In addition
to being smaller than a full 8 byte address, this also does not require
a dynamic relocation when used in a shared library.
@item .t_floating @var{expression}
Stores @var{expression} as an @sc{ieee} double precision value.
@item .s_floating @var{expression}
Stores @var{expression} as an @sc{ieee} single precision value.
@item .f_floating @var{expression}
Stores @var{expression} as a VAX F format value.
@item .g_floating @var{expression}
Stores @var{expression} as a VAX G format value.
@item .d_floating @var{expression}
Stores @var{expression} as a VAX D format value.
@item .set @var{feature}
Enables or disables various assembler features. Using the positive
name of the feature enables while using @samp{no@var{feature}} disables.
@table @code
@item at
Indicates that macro expansions may clobber the @dfn{assembler
temporary} (@code{$at} or @code{$28}) register. Some macros may not be
expanded without this and will generate an error message if @code{noat}
is in effect. When @code{at} is in effect, a warning will be generated
if @code{$at} is used by the programmer.
@item macro
Enables the expansion of macro instructions. Note that variants of real
instructions, such as @code{br label} vs @code{br $31,label} are
considered alternate forms and not macros.
@item move
@itemx reorder
@itemx volatile
These control whether and how the assembler may re-order instructions.
Accepted for compatibility with the OSF/1 assembler, but @command{@value{AS}}
does not do instruction scheduling, so these features are ignored.
@end table
@end table
The following directives are recognized for compatibility with the OSF/1
assembler but are ignored.
@example
.proc .aproc
.reguse .livereg
.option .aent
.ugen .eflag
.alias .noalias
@end example
@node Alpha Opcodes
@section Opcodes
For detailed information on the Alpha machine instruction set, see the
@c Attempt to work around a very overfull hbox.
@iftex
Alpha Architecture Handbook located at
@smallfonts
@example
ftp://ftp.digital.com/pub/Digital/info/semiconductor/literature/alphaahb.pdf
@end example
@textfonts
@end iftex
@ifnottex
@uref{ftp://ftp.digital.com/pub/Digital/info/semiconductor/literature/alphaahb.pdf,Alpha Architecture Handbook}.
@end ifnottex