1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773
|
@c Copyright (C) 2009-2026 Free Software Foundation, Inc.
@c Contributed by ARM Ltd.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@c man end
@ifset GENERIC
@page
@node AArch64-Dependent
@chapter AArch64 Dependent Features
@end ifset
@ifclear GENERIC
@node Machine Dependencies
@chapter AArch64 Dependent Features
@end ifclear
@cindex AArch64 support
@menu
* AArch64 Options:: Options
* AArch64 Extensions:: Extensions
* AArch64 Syntax:: Syntax
* AArch64 Floating Point:: Floating Point
* AArch64 Directives:: AArch64 Machine Directives
* AArch64 Opcodes:: Opcodes
* AArch64 Mapping Symbols:: Mapping Symbols
@end menu
@node AArch64 Options
@section Options
@cindex AArch64 options (none)
@cindex options for AArch64 (none)
@c man begin OPTIONS
@table @gcctabopt
@cindex @option{-EB} command-line option, AArch64
@item -EB
This option specifies that the output generated by the assembler should
be marked as being encoded for a big-endian processor.
@cindex @option{-EL} command-line option, AArch64
@item -EL
This option specifies that the output generated by the assembler should
be marked as being encoded for a little-endian processor.
@cindex @option{-mabi=} command-line option, AArch64
@item -mabi=@var{abi}
Specify which ABI the source code uses. The recognized arguments
are: @code{ilp32} and @code{lp64}, which decides the generated object
file in ELF32 and ELF64 format respectively. The default is @code{lp64}.
@cindex @option{-mcpu=} command-line option, AArch64
@item -mcpu=@var{processor}[+@var{extension}@dots{}]
This option specifies the target processor. The assembler will issue an error
message if an attempt is made to assemble an instruction which will not execute
on the target processor. The following processor names are recognized:
@code{cortex-a34},
@code{cortex-a35},
@code{cortex-a53},
@code{cortex-a55},
@code{cortex-a57},
@code{cortex-a65},
@code{cortex-a65ae},
@code{cortex-a72},
@code{cortex-a73},
@code{cortex-a75},
@code{cortex-a76},
@code{cortex-a76ae},
@code{cortex-a77},
@code{cortex-a78},
@code{cortex-a78ae},
@code{cortex-a78c},
@code{cortex-a510},
@code{cortex-a520},
@code{cortex-a710},
@code{cortex-a720},
@code{ares},
@code{exynos-m1},
@code{falkor},
@code{neoverse-n1},
@code{neoverse-n2},
@code{neoverse-e1},
@code{neoverse-v1},
@code{qdf24xx},
@code{saphira},
@code{thunderx},
@code{vulcan},
@code{xgene1}
@code{xgene2},
@code{cortex-r82},
@code{cortex-x1},
@code{cortex-x2},
@code{cortex-x3},
and
@code{cortex-x4}.
The special name @code{all} may be used to allow the assembler to accept
instructions valid for any supported processor, including all optional
extensions.
In addition to the basic instruction set, the assembler can be told to
accept, or restrict, various extension mnemonics that extend the
processor. @xref{AArch64 Extensions}.
If some implementations of a particular processor can have an
extension, then then those extensions are automatically enabled.
Consequently, you will not normally have to specify any additional
extensions.
@cindex @option{-march=} command-line option, AArch64
@item -march=@var{architecture}[+@var{extension}@dots{}]
This option specifies the target architecture. The assembler will
issue an error message if an attempt is made to assemble an
instruction which will not execute on the target architecture. The
following architecture names are recognized: @code{armv8-a},
@code{armv8.1-a}, @code{armv8.2-a}, @code{armv8.3-a}, @code{armv8.4-a}
@code{armv8.5-a}, @code{armv8.6-a}, @code{armv8.7-a}, @code{armv8.8-a},
@code{armv8.9-a}, @code{armv8-r}, @code{armv9-a}, @code{armv9.1-a},
@code{armv9.2-a}, @code{armv9.3-a}, @code{armv9.4-a} and @code{armv9.5-a}.
If both @option{-mcpu} and @option{-march} are specified, the
assembler will use the setting for @option{-mcpu}. If neither are
specified, the assembler will default to @option{-mcpu=all}.
The architecture option can be extended with the same instruction set
extension options as the @option{-mcpu} option. Unlike
@option{-mcpu}, extensions are not always enabled by default.
@xref{AArch64 Extensions}.
@cindex @samp{-mbig-obj} option, AArch64
@item -mbig-obj
On PE/COFF target this option forces the use of big object file
format, which allows more than 32768 sections.
@cindex @code{-mverbose-error} command-line option, AArch64
@item -mverbose-error
This option enables verbose error messages for AArch64 gas. This option
is enabled by default.
@cindex @code{-mno-verbose-error} command-line option, AArch64
@item -mno-verbose-error
This option disables verbose error messages in AArch64 gas.
@cindex @code{-menable-sysreg-checking} command-line option, AArch64
@item -menable-sysreg-checking
This option enables error messages that are issued if an attempt is made to
assemble a system register access which will not execute on the target
architecture.
@end table
@c man end
@node AArch64 Extensions
@section Architecture Extensions
The tables below lists the permitted architecture extensions and architecture
versions that are supported by the assembler, including a brief description and
a list of other extensions that they depend upon.
Multiple extensions may be specified, separated by a @code{+}.
Extension mnemonics may also be removed from those the assembler
accepts. This is done by prepending @code{no} to the option that adds
the extension. Extensions that are removed must be listed after all
extensions that have been added.
Enabling an extension that depends upon other extensions (either directly or
recursively) will automatically cause those extensions to be enabled.
Similarly, disabling an extension that is required by other extensions will
automatically cause those extensions to be disabled.
@multitable @columnfractions .16 .22 .62
@headitem Extension @tab Depends upon @tab Description
@item @code{aes} @tab @code{simd}
@tab Enable the AES and PMULL cryptographic extensions.
@item @code{bf16} @tab @code{fp}
@tab Enable BFloat16 extension.
@item @code{brbe} @tab
@tab Enable the Branch Record Buffer extension.
@item @code{chk} @tab
@tab Enable the Check Feature Status Extension.
@item @code{cmpbr} @tab
@tab Enable Compare and Branch instructions.
@item @code{compnum} @tab @code{simd}
@tab Enable the complex number SIMD extensions. An alias of @code{fcma}.
@item @code{cpa} @tab
@tab Enable the Checked Pointer Arithmetic extension.
@item @code{crc} @tab
@tab Enable CRC instructions.
@item @code{crypto} @tab @code{simd}
@tab Enable cryptographic extensions. This is equivalent to @code{aes+sha2}.
@item @code{cssc} @tab
@tab Enable the Armv8.9-A Common Short Sequence Compression instructions.
@item @code{d128} @tab @code{lse128}
@tab Enable the 128-bit Page Descriptor Extension. This implies @code{lse128}.
@item @code{dotprod} @tab @code{simd}
@tab Enable the Dot Product extension.
@item @code{f16f32dot} @tab @code{simd}, @code{fp16}
@tab Enable Armv9.7 f16f32dot instructions.
@item @code{f16f32mm} @tab @code{simd}, @code{fp16}
@tab Enable Armv9.7 f16f32mm instructions.
@item @code{f16mm} @tab @code{simd}, @code{fp16}
@tab Enable f16mm instructions.
@item @code{f32mm} @tab @code{sve}
@tab Enable the F32 Matrix Multiply extension.
@item @code{f64mm} @tab @code{sve}
@tab Enable the F64 Matrix Multiply extension.
@item @code{f8f16mm} @tab @code{simd} @code{fp8}
@tab Enable 8-bit floating-point matrix multiply-accumulate to half-precision instructions.
@item @code{f8f32mm} @tab @code{simd} @code{fp}
@tab Enable 8-bit floating-point matrix multiply-accumulate to single-precision instructions.
@item @code{faminmax} @tab @code{simd}
@tab Enable the famin and famax instructions.
@item @code{fcma} @tab @code{fp16}, @code{simd}
@tab Enable the complex number SIMD extensions.
@item @code{flagm} @tab
@tab Enable Flag Manipulation instructions.
@item @code{flagm2} @tab @code{flagm}
@tab Enable FlagM2 flag conversion instructions.
@item @code{fp} @tab
@tab Enable floating-point extensions.
@item @code{fp8} @tab
@tab Enable the Floating Point 8 (FP8) extension.
@item @code{fp8dot2} @tab @code{fp8}
@tab Enable the FP8 2-way dot product instructions.
@item @code{fp8dot4} @tab @code{fp8}
@tab Enable the FP8 4-way dot product instructions.
@item @code{fp8fma} @tab @code{fp8}
@tab Enable the FP8 FMA instructions.
@item @code{fp16fml} @tab @code{fp16}
@tab Enable Armv8.2 16-bit floating-point multiplication variant support.
@item @code{fp16} @tab @code{fp}
@tab Enable Armv8.2 16-bit floating-point support.
@item @code{fprcvt} @tab @code{fp}
@tab Enable Armv9.6 fprcvt instructions.
@item @code{frintts} @tab @code{fp}
@tab Enable floating-point round to integral value instructions.
@item @code{gcie} @tab
@tab Enable the GICv5 (Generic Interrupt Controller) CPU Interface Extension.
@item @code{gcs} @tab
@tab Enable the Guarded Control Stack Extension.
@item @code{hbc} @tab
@tab Enable Armv8.8-A hinted conditional branch instructions.
@item @code{i8mm} @tab @code{simd}
@tab Enable the Int8 Matrix Multiply extension.
@item @code{ite} @tab
@tab Enable the TRCIT instruction.
@item @code{jscvt} @tab @code{fp}
@tab Enable the @code{fjcvtzs} JavaScript conversion instruction.
@item @code{lor} @tab
@tab Enable Limited Ordering Regions extensions.
@item @code{ls64} @tab
@tab Enable the 64 Byte Loads/Stores extensions.
@item @code{lscp} @tab
@tab Enable the load acquire and store release pair extension.
@item @code{lse} @tab
@tab Enable Large System extensions.
@item @code{lse128} @tab @code{lse}
@tab Enable the 128-bit Atomic Instructions extension.
@item @code{lsfe} @tab @code{fp}
@tab Enable Large System Float Extension.
@item @code{lsui} @tab
@tab Enable Unprivileged Load/Store instructions.
@item @code{lut} @tab @code{simd}
@tab Enable the Lookup Table (LUT) extension.
@item @code{memtag} @tab
@tab Enable Armv8.5-A Memory Tagging Extensions.
@item @code{mops} @tab
@tab Enable Armv8.8-A memcpy and memset acceleration instructions.
@item @code{mops-go} @tab @code{mops}, @code{memtag}
@tab Enable tag only variants of MOPS instructions.
@item @code{mpamv2} @tab
@tab Enable MPAMv2 system registers.
@item @code{mtetc} @tab @code{memtag}
@tab Enable Data cache tag block operations.
@item @code{occmo} @tab
@tab Enable Outer Cacheable Cache Maintenance Operations.
@item @code{pan} @tab
@tab Enable Privileged Access Never support.
@item @code{pauth} @tab
@tab Enable Pointer Authentication.
@item @code{poe2} @tab
@tab Enable Permission overlays extension 2.
@item @code{pops} @tab
@tab Enable Point of Physical Storage.
@item @code{predres} @tab
@tab Enable execution and data prediction restriction instructions.
@item @code{predres2} @tab @code{predres}
@tab Enable additional prediction restriction instructions.
@item @code{profile} @tab
@tab Enable statistical profiling extensions.
@item @code{ras} @tab
@tab Enable the Reliability, Availability and Serviceability extension.
@item @code{rasv2} @tab @code{ras}
@tab Enable the Reliability, Availability and Serviceability extension v2.
@item @code{rcpc} @tab
@tab Enable the Load-Acquire RCpc instructions extension.
@item @code{rcpc2} @tab @code{rcpc}
@tab Enable the Load-Acquire RCpc instructions extension v2.
@item @code{rcpc3} @tab @code{rcpc2}
@tab Enable the Load-Acquire RCpc instructions extension v3.
@item @code{rdma} @tab @code{simd}
@tab Enable rounding doubling multiply accumulate instructions.
@item @code{rdm} @tab @code{simd}
@tab An alias of @code{rdma}.
@item @code{rng} @tab
@tab Enable Armv8.5-A random number instructions.
@item @code{sb} @tab
@tab Enable the speculation barrier instruction sb.
@item @code{sha2} @tab @code{simd}
@tab Enable the SHA1 and SHA256 cryptographic extensions.
@item @code{sha3} @tab @code{sha2}
@tab Enable the SHA512 and SHA3 cryptographic extensions.
@item @code{simd} @tab @code{fp}
@tab Enable Advanced SIMD extensions.
@item @code{sm4} @tab @code{simd}
@tab Enable the SM3 and SM4 cryptographic extensions.
@item @code{sme} @tab @code{bf16}, @code{fp16}, @code{fcma}
@tab Enable the Scalable Matrix Extension. This will also enable @code{sve2}, but disabling @code{sve2} does not disable @code{sme}.
@item @code{sme-b16b16} @tab @code{sme2}, @code{sve-b16b16}
@tab Enable SME ZA-targeting non-widening BFloat16 instructions.
@item @code{sme-f8f16} @tab @code{sme2}, @code{fp8}
@tab Enable the SME F8F16 Extension.
@item @code{sme-f8f32} @tab @code{sme2}, @code{fp8}
@tab Enable the SME F8F32 Extension.
@item @code{sme-f16f16} @tab @code{sme2}
@tab Enable the SME2 F16F16 Extension.
@item @code{sme-f64f64} @tab @code{sme}
@tab Enable SME F64F64 Extension.
@item @code{sme-i16i64} @tab @code{sme}
@tab Enable SME I16I64 Extension.
@item @code{sme-lutv2} @tab
@tab Enable SME Lookup Table v2 (LUTv2) extension.
@item @code{sme-mop4} @tab @code{sme2}
@tab Enable SME Quarter-tile outer product instructions.
@item @code{sme-tmop} @tab @code{sme2}
@tab Enable SME structured sparsity outer product instructions.
@item @code{sme2} @tab @code{sme}
@tab Enable SME2.
@item @code{sme2p1} @tab @code{sme2}
@tab Enable SME2.1.
@item @code{sme2p2} @tab @code{sme2p1}
@tab Enable SME2.2.
@item @code{sme2p3} @tab @code{sme2p2}
@tab Enable SME2.3.
@item @code{ssbs} @tab
@tab Enable Speculative Store Bypassing Safe state read and write.
@item @code{ssve-aes} @tab @code{sme2}, @code{sve-aes}
@tab Enable SVE AES instructions in streaming mode.
@item @code{ssve-bitperm} @tab @code{sme2}, @code{sve-bitperm}
@tab Enable SVE AES instructions in streaming mode.
@item @code{ssve-fexpa} @tab @code{sme2}
@tab Enable the SVE FEXPA instruction in streaming mode.
@item @code{ssve-fp8dot2} @tab @code{sme2}, @code{fp8}
@tab Enable the Streaming SVE FP8 2-way dot product instructions.
@item @code{ssve-fp8dot4} @tab @code{sme2}, @code{fp8}
@tab Enable the Streaming SVE FP8 4-way dot product instructions.
@item @code{ssve-fp8fma} @tab @code{sme2}, @code{fp8}
@tab Enable the Streaming SVE FP8 FMA instructions.
@item @code{sve} @tab @code{fcma}
@tab Enable the Scalable Vector Extension.
@item @code{sve-aes} @tab @code{aes}
@tab Enable the SVE2 AES and PMULL Extensions.
@item @code{sve-aes2} @tab
@tab Enable the SVE-AES2 extension.
@item @code{sve-b16b16} @tab
@tab Enable the SVE B16B16 extension. These instructions also require either @code{+sve2} or @code{+sme2}.
@item @code{sve-b16mm} @tab @code{sve}
@tab Enable the SVE B16MM Extension.
@item @code{sve-bfscale} @tab
@tab Enable the SVE BFSCALE extension. These instructions also require either @code{+sve2} or @code{+sme2}.
@item @code{sve-bitperm} @tab
@tab Enable the SVE2 BITPERM Extension.
@item @code{sve-f16f32mm} @tab @code{sve}
@tab Enable the SVE_F16F32MM extension.
@item @code{sve2} @tab @code{sve}
@tab Enable SVE2.
@item @code{sve2-aes} @tab @code{sve2}, @code{sve-aes}
@tab Enable the SVE2 AES and PMULL Extensions.
@item @code{sve2-bitperm} @tab @code{sve2}, @code{sve-bitperm}
@tab Enable the SVE2 BITPERM Extension.
@item @code{sve2-sha3} @tab @code{sve2}, @code{sha3}
@tab Enable the SVE2 SHA3 Extension.
@item @code{sve2-sm4} @tab @code{sve2}, @code{sm4}
@tab Enable the SVE2 SM4 Extension.
@item @code{sve2p1} @tab @code{sve2}
@tab Enable SVE2.1.
@item @code{sve2p2} @tab @code{sve2p1}
@tab Enable SVE2.2.
@item @code{sve2p3} @tab @code{sve2p2}
@tab Enable SVE2.3.
@item @code{tev} @tab
@tab TIndex Exception-like Vector Extension.
@item @code{the} @tab
@tab Enable the Translation Hardening Extension.
@item @code{tlbid} @tab
@tab Enable the TLBI Domains Extension.
@item @code{tme} @tab
@tab Enable the Transactional Memory Extension.
@item @code{wfxt} @tab
@tab Enable @code{wfet} and @code{wfit} instructions.
@item @code{xs} @tab
@tab Enable the XS memory attribute extension.
@end multitable
@multitable @columnfractions .20 .80
@headitem Architecture Version @tab Includes
@item @code{armv8-a} @tab @code{simd}, @code{chk}, @code{ras}
@item @code{armv8.1-a} @tab @code{armv8-a}, @code{crc}, @code{lse}, @code{rdma}, @code{pan}, @code{lor}
@item @code{armv8.2-a} @tab @code{armv8.1-a}
@item @code{armv8.3-a} @tab @code{armv8.2-a}, @code{fcma}, @code{jscvt}, @code{pauth}, @code{rcpc}
@item @code{armv8.4-a} @tab @code{armv8.3-a}, @code{fp16fml}, @code{dotprod}, @code{flagm}, @code{rcpc2}
@item @code{armv8.5-a} @tab @code{armv8.4-a}, @code{frintts}, @code{flagm2}, @code{predres}, @code{sb}, @code{ssbs}
@item @code{armv8.6-a} @tab @code{armv8.5-a}, @code{bf16}, @code{i8mm}
@item @code{armv8.7-a} @tab @code{armv8.6-a}, @code{ls64}, @code{xs}, @code{wfxt}
@item @code{armv8.8-a} @tab @code{armv8.7-a}, @code{hbc}, @code{mops}
@item @code{armv8.9-a} @tab @code{armv8.8-a}, @code{rasv2}, @code{predres2}
@item @code{armv9-a} @tab @code{armv8.5-a}, @code{sve2}
@item @code{armv9.1-a} @tab @code{armv9-a}, @code{armv8.6-a}
@item @code{armv9.2-a} @tab @code{armv9.1-a}, @code{armv8.7-a}
@item @code{armv9.3-a} @tab @code{armv9.2-a}, @code{armv8.8-a}
@item @code{armv9.4-a} @tab @code{armv9.3-a}, @code{armv8.9-a}
@item @code{armv9.5-a} @tab @code{armv9.4-a}, @code{cpa}, @code{lut}, @code{faminmax}
@item @code{armv9.6-a} @tab @code{armv9.5-a}, @code{cmpbr}, @code{lsui}, @code{occmo}
@item @code{armv9.7-a} @tab @code{armv9.6-a}, @code{sve2p2}, @code{sve2p3}, @code{f16f32dot}
@item @code{armv8-r} @tab @code{armv8.4-a+nolor}
@end multitable
@node AArch64 Syntax
@section Syntax
@menu
* AArch64-Chars:: Special Characters
* AArch64-Regs:: Register Names
* AArch64-Relocations:: Relocations
@end menu
@node AArch64-Chars
@subsection Special Characters
@cindex line comment character, AArch64
@cindex AArch64 line comment character
The presence of a @samp{//} on a line indicates the start of a comment
that extends to the end of the current line. If a @samp{#} appears as
the first character of a line, the whole line is treated as a comment.
@cindex line separator, AArch64
@cindex statement separator, AArch64
@cindex AArch64 line separator
The @samp{;} character can be used instead of a newline to separate
statements.
@cindex immediate character, AArch64
@cindex AArch64 immediate character
The @samp{#} can be optionally used to indicate immediate operands.
@node AArch64-Regs
@subsection Register Names
@cindex AArch64 register names
@cindex register names, AArch64
Please refer to the section @samp{Register names} of @samp{Arm
Architecture Reference Manual for A-profile architecture}, which
is available at @uref{https://developer.arm.com/}.
@node AArch64-Relocations
@subsection Relocations
@cindex relocations, AArch64
@cindex AArch64 relocations
@cindex MOVN, MOVZ and MOVK group relocations, AArch64
Relocations for @samp{MOVZ} and @samp{MOVK} instructions can be generated
by prefixing the label with @samp{#:abs_g2:} etc.
For example to load the 48-bit absolute address of @var{foo} into x0:
@smallexample
movz x0, #:abs_g2:foo // bits 32-47, overflow check
movk x0, #:abs_g1_nc:foo // bits 16-31, no overflow check
movk x0, #:abs_g0_nc:foo // bits 0-15, no overflow check
@end smallexample
@cindex ADRP, ADD, LDR/STR group relocations, AArch64
Relocations for @samp{ADRP}, and @samp{ADD}, @samp{LDR} or @samp{STR}
instructions can be generated by prefixing the label with
@samp{:pg_hi21:} and @samp{#:lo12:} respectively.
For example to use 33-bit (+/-4GB) pc-relative addressing to
load the address of @var{foo} into x0:
@smallexample
adrp x0, :pg_hi21:foo
add x0, x0, #:lo12:foo
@end smallexample
Or to load the value of @var{foo} into x0:
@smallexample
adrp x0, :pg_hi21:foo
ldr x0, [x0, #:lo12:foo]
@end smallexample
Note that @samp{:pg_hi21:} is optional.
@smallexample
adrp x0, foo
@end smallexample
is equivalent to
@smallexample
adrp x0, :pg_hi21:foo
@end smallexample
@node AArch64 Floating Point
@section Floating Point
@cindex floating point, AArch64 (@sc{ieee})
@cindex AArch64 floating point (@sc{ieee})
The AArch64 architecture uses @sc{ieee} floating-point numbers.
@node AArch64 Directives
@section AArch64 Machine Directives
@cindex machine directives, AArch64
@cindex AArch64 machine directives
@table @code
@c AAAAAAAAAAAAAAAAAAAAAAAAA
@cindex @code{.aeabi_subsection} directive, AArch64
@item .aeabi_subsection @var{name}, @var{comprehension}, @var{encoding}
Create or switch the current object attributes subsection to @var{name}. Valid
values for @var{name} are following the pattern @code{[a-zA-Z0-9_]+}.
The subsection property @var{comprehension} determines how a program processing
the attributes handles attributes that it does not recognize (perhaps because
the object file was generated by a different version of the toolchain). A
subsection that is marked @code{optional} can be skipped if it is not
understood. A subsection marked @code{required} implies that information
conveyed by the attribute is required for correct processing of the object file;
a fatal diagnostic must be generated if a tool does not recognize either the tag
or the value associated with it.
@var{encoding} specifies the expected encoding of the attributes recorded in the
subsection. Currently supported values are @code{ULEB128}/@code{uleb128} and
@code{NTBS}/@code{ntbs} (null-terminated byte string).
On the first declaration of a subsection, both @var{comprehension} and
@var{encoding} are mandatory parameters. However, on subsequent declarations,
none of the parameters is required. If they are still specified, their values
will be matched against the ones from the first declaration. Any mismatch will
be reported as an error.
@cindex @code{.aeabi_attribute} @var{tag}, @var{value}
@item .aeabi_attribute @var{tag}, @var{value}
Create an attribute with the pair @var{tag}, @var{value} in the current
subsection. @var{tag} can either be an integer value, or a known named key.
@var{value} can either be an integer or a string.
The complete list of subsections and tags supported on AArch64 is documented
in @cite{Build Attributes for the Arm 64-bit Architecture (AArch64)}.
@cindex @code{.arch} directive, AArch64
@item .arch @var{name}
Select the target architecture. Valid values for @var{name} are the same as
for the @option{-march} command-line option.
Specifying @code{.arch} clears any previously selected architecture
extensions.
@cindex @code{.arch_extension} directive, AArch64
@item .arch_extension @var{name}
Add or remove an architecture extension to the target architecture. Valid
values for @var{name} are the same as those accepted as architectural
extensions by the @option{-mcpu} command-line option.
@code{.arch_extension} may be used multiple times to add or remove extensions
incrementally to the architecture being compiled for.
@c BBBBBBBBBBBBBBBBBBBBBBBBBB
@c CCCCCCCCCCCCCCCCCCCCCCCCCC
@cindex @code{.cfi_mte_tagged_frame} directive, AArch64
@item @code{.cfi_mte_tagged_frame}
The @code{.cfi_mte_tagged_frame} directive inserts a 'G' character into the
CIE corresponding to the current frame's FDE, meaning that the associated
frames may modify MTE tags on the stack space they use. This information is
intended to be used by the stack unwinder in order to properly untag stack
frames.
@cindex @code{.cpu} directive, AArch64
@item .cpu @var{name}
Set the target processor. Valid values for @var{name} are the same as
those accepted by the @option{-mcpu=} command-line option.
@c DDDDDDDDDDDDDDDDDDDDDDDDDD
@cindex @code{.dword} directive, AArch64
@item .dword @var{expressions}
The @code{.dword} directive produces 64 bit values.
@c EEEEEEEEEEEEEEEEEEEEEEEEEE
@cindex @code{.even} directive, AArch64
@item .even
The @code{.even} directive aligns the output on the next even byte
boundary.
@c FFFFFFFFFFFFFFFFFFFFFFFFFF
@cindex @code{.float16} directive, AArch64
@item .float16 @var{value [,...,value_n]}
Place the half precision floating point representation of one or more
floating-point values into the current section.
The format used to encode the floating point values is always the
IEEE 754-2008 half precision floating point format.
@c GGGGGGGGGGGGGGGGGGGGGGGGGG
@c HHHHHHHHHHHHHHHHHHHHHHHHHH
@c IIIIIIIIIIIIIIIIIIIIIIIIII
@cindex @code{.inst} directive, AArch64
@item .inst @var{expressions}
Inserts the expressions into the output as if they were instructions,
rather than data.
@c JJJJJJJJJJJJJJJJJJJJJJJJJJ
@c KKKKKKKKKKKKKKKKKKKKKKKKKK
@c LLLLLLLLLLLLLLLLLLLLLLLLLL
@cindex @code{.ltorg} directive, AArch64
@item .ltorg
This directive causes the current contents of the literal pool to be
dumped into the current section (which is assumed to be the .text
section) at the current location (aligned to a word boundary).
GAS maintains a separate literal pool for each section and each
sub-section. The @code{.ltorg} directive will only affect the literal
pool of the current section and sub-section. At the end of assembly
all remaining, un-empty literal pools will automatically be dumped.
Note - older versions of GAS would dump the current literal
pool any time a section change occurred. This is no longer done, since
it prevents accurate control of the placement of literal pools.
@c MMMMMMMMMMMMMMMMMMMMMMMMMM
@c NNNNNNNNNNNNNNNNNNNNNNNNNN
@c OOOOOOOOOOOOOOOOOOOOOOOOOO
@c PPPPPPPPPPPPPPPPPPPPPPPPPP
@cindex @code{.pool} directive, AArch64
@item .pool
This is a synonym for .ltorg.
@c QQQQQQQQQQQQQQQQQQQQQQQQQQ
@c RRRRRRRRRRRRRRRRRRRRRRRRRR
@cindex @code{.req} directive, AArch64
@item @var{name} .req @var{register name}
This creates an alias for @var{register name} called @var{name}. For
example:
@smallexample
foo .req w0
@end smallexample
ip0, ip1, lr and fp are automatically defined to
alias to X16, X17, X30 and X29 respectively.
@c SSSSSSSSSSSSSSSSSSSSSSSSSS
@c TTTTTTTTTTTTTTTTTTTTTTTTTT
@cindex @code{.tlsdescadd} directive, AArch64
@item @code{.tlsdescadd}
Emits a TLSDESC_ADD reloc on the next instruction.
@cindex @code{.tlsdesccall} directive, AArch64
@item @code{.tlsdesccall}
Emits a TLSDESC_CALL reloc on the next instruction.
@cindex @code{.tlsdescldr} directive, AArch64
@item @code{.tlsdescldr}
Emits a TLSDESC_LDR reloc on the next instruction.
@c UUUUUUUUUUUUUUUUUUUUUUUUUU
@cindex @code{.unreq} directive, AArch64
@item .unreq @var{alias-name}
This undefines a register alias which was previously defined using the
@code{req} directive. For example:
@smallexample
foo .req w0
.unreq foo
@end smallexample
An error occurs if the name is undefined. Note - this pseudo op can
be used to delete builtin in register name aliases (eg 'w0'). This
should only be done if it is really necessary.
@c VVVVVVVVVVVVVVVVVVVVVVVVVV
@cindex @code{.variant_pcs} directive, AArch64
@item .variant_pcs @var{symbol}
This directive marks @var{symbol} referencing a function that may
follow a variant procedure call standard with different register
usage convention from the base procedure call standard.
@c WWWWWWWWWWWWWWWWWWWWWWWWWW
@c XXXXXXXXXXXXXXXXXXXXXXXXXX
@cindex @code{.xword} directive, AArch64
@item .xword @var{expressions}
The @code{.xword} directive produces 64 bit values. This is the same
as the @code{.dword} directive.
@c YYYYYYYYYYYYYYYYYYYYYYYYYY
@c ZZZZZZZZZZZZZZZZZZZZZZZZZZ
@cindex @code{.cfi_b_key_frame} directive, AArch64
@item @code{.cfi_b_key_frame}
The @code{.cfi_b_key_frame} directive inserts a 'B' character into the CIE
corresponding to the current frame's FDE, meaning that its return address has
been signed with the B-key. If two frames are signed with differing keys then
they will not share the same CIE. This information is intended to be used by
the stack unwinder in order to properly authenticate return addresses.
@end table
@node AArch64 Opcodes
@section Opcodes
@cindex AArch64 opcodes
@cindex opcodes for AArch64
GAS implements all the standard AArch64 opcodes. It also
implements several pseudo opcodes, including several synthetic load
instructions.
@table @code
@cindex @code{LDR reg,=<expr>} pseudo op, AArch64
@item LDR =
@smallexample
ldr <register> , =<expression>
@end smallexample
The constant expression will be placed into the nearest literal pool (if it not
already there) and a PC-relative LDR instruction will be generated.
@end table
For more information on the AArch64 instruction set and assembly language
notation, see @samp{Arm Architecture Reference Manual for A-profile
architecture} available at @uref{https://developer.arm.com/}.
@node AArch64 Mapping Symbols
@section Mapping Symbols
The AArch64 ELF specification requires that special symbols be inserted
into object files to mark certain features:
@table @code
@cindex @code{$x}
@item $x
At the start of a region of code containing AArch64 instructions.
@cindex @code{$d}
@item $d
At the start of a region of data.
@end table
|