465 Commits

Author SHA1 Message Date
Sam Tebbs
fb8dbd1fb6
[AArch64] Remove copy in SVE/SME predicate spill and fill (#81716)
7dc20ab introduced an extra COPY when spilling and filling a PNR
register, which can't be elided as the input (PNR predicate) and output
(PPR predicate) register classes differ. The patch adds a new register
class that covers both PPR and PNR so that STR_PXI and LDR_PXI can
take either of them, removing the need for the copy.
2024-04-09 16:17:27 +01:00
Sergei Barannikov
5e5b656102
[MC] Make MCParsedAsmOperand::getReg() return MCRegister (#86444) 2024-03-25 05:13:48 +03:00
CarolineConcatto
bb87c914fe
[AArch64][SVE]Add error message in the AsmParser for SVEPattern (#82668)
All assembly instructions that have an operand using sve_pred_enum and
mistakenly use '#' in front of it would fail without an error message.
2024-02-26 11:30:04 +00:00
Fangrui Song
442f066fc4 [AArch64AsmParser] Support (xxx), lsl 16 after #80571
An immediate integer operand not prefixed with # can also be followed
by "lsl". Parse "lsl".
In the wild, edk2 ArmPkg/Include/AsmMacroIoLibV8.h has
`movz      Reg, (Val) >> 16, lsl #16`.

Note: our support for paren expression not prefixed with # is not very
good. For example, `adds x3, x4, (1024>>0), lsl 12` fails to be parsed.
2024-02-19 00:57:48 -08:00
Sergei Barannikov
1e4c76cdc9
[MC][AsmParser] Make MatchRegisterName return MCRegister (NFC) (#81408)
`MCRegister` is preferred over `unsigned` nowadays.
2024-02-18 13:59:49 +03:00
Fangrui Song
5da801386c
[AArch64AsmParser] Allow branch target symbol to have a shift/extend modifier name (#80571)
Shift and extend modifiers are parsed as separate operands. When a
symbol operand of a branch instruction has such a "bad" name,
AArch64AsmParser will report an error.

```
% cat a.c
void lsl(); void lsr(); void asr(); void ror(); void uxtb(); void sxtx();
void foo() { lsl(); asr(); asr(); ror(); uxtb(); sxtx(); }
% clang --target=aarch64 -c -save-temps a.c
a.s:15:8: error: expected #imm after shift specifier
        bl      lsl
                   ^
a.s:16:8: error: expected #imm after shift specifier
        bl      asr
                   ^
a.s:17:8: error: expected #imm after shift specifier
        bl      asr
                   ^
a.s:18:8: error: expected #imm after shift specifier
        bl      ror
                   ^
a.s:19:5: error: expected label or encodable integer pc offset
        bl      uxtb
                ^
a.s:20:5: error: expected label or encodable integer pc offset
        bl      sxtx
                ^
```

In contrast, gas correctly parses these instructions.

Fix #79729 by parsing shift/extend modifier after an immediate
value/register
2024-02-11 20:21:29 -08:00
Kazu Hirata
c0396e15c3 [AArch64] Use StringRef::contains_insensitive (NFC) 2024-01-19 18:54:09 -08:00
ostannard
13e977d173
[AArch64][Driver] Better handling of target feature dependencies (#78270)
Currently there are several bits of code in the AArch64 driver which
attempt to enforce dependencies between optional features in the -march=
and -mcpu= options. However, these are based on the list of feature
names being enabled/disabled, so they have a lot of logic to consider
the order in which features were turned on and off, which doesn't scale
well as dependency chains get longer.

This patch moves the code handling these dependencies to TargetParser,
and changes them to use a Bitset of enabled features. This makes it easy
to check which features are enabled, and is converted back to a list of
LLVM feature names once all of the command-line options are parsed.

The motivating example for this was the -mcpu=cortex-r82+nofp option.
Previously, the code handling the dependency between the fp16 and
fp16fml extensions did not consider the nofp modifier, so it added
+fullfp16 to the feature list. This should have been disabled by the
+nofp modifier, and also the backend did follow the dependency between
fullfp16 and fp, resulting in fp being turned back on in the backend.

Most of the dependencies added to AArch64TargetParser.h weren't known
about by clang before, I built that list by checking what the backend
thinks the dependencies between SubtargetFeatures are.
2024-01-17 16:20:34 +00:00
Kazu Hirata
5e9da33b87 [llvm] Use StringRef::consume_front_insensitive (NFC) 2024-01-11 22:48:20 -08:00
Momchil Velikov
90eb4e2455
[AArch64] Fix missing pfalse diagnostic (#77746)
The missing diagnostic causes an ICE when a suffix other than `.B`
is used in a `pfalse` instruction with a predicate-as-counter operand.
2024-01-11 16:44:32 +00:00
Lucas Duarte Prates
e4f1c52832
[AArch64] Assembly support for the Armv9.5-A Memory System Extensions (#76237)
This implements assembly support for the Memory Systems Extensions
introduced as part of the Armv9.5-A architecture version.
The changes include:
* New subtarget feature for FEAT_TLBIW.
* New system registers for FEAT_HDBSS:
  * HDBSSBR_EL2 and HDBSSPROD_EL2.
* New system registers for FEAT_HACDBS:
  * HACDBSBR_EL2 and HACDBSCONS_EL2.
* New TLBI instructions for FEAT_TLBIW:
  * VMALLWS2E1(nXS), VMALLWS2E1IS(nXS) and VMALLWS2E1OS(nXS).
* New system register for FEAT_FGWTE3:
  * FGWTE3_EL3.
2023-12-22 14:40:29 +00:00
Tomas Matheson
192f720178 Re-land "[AArch64] Add FEAT_PAuthLR assembler support" (#75947)
This reverts commit 199a0f9f5aaf72ff856f68e3bb708e783252af17.
Fixed the left-shift of signed integer which was causing UB.
2023-12-21 18:09:31 +00:00
Tomas Matheson
199a0f9f5a Revert "[AArch64] Add FEAT_PAuthLR assembler support"
This reverts commit 934b1099cbf14fa3f86a269dff957da8e5fb619f.

Buildbot failues on sanitizer-x86_64-linux-fast
2023-12-21 16:26:39 +00:00
Oliver Stannard
934b1099cb [AArch64] Add FEAT_PAuthLR assembler support
Add assembly/disassembly support for the new PAuthLR instructions
introduced in Armv9.5-A:

- AUTIASPPC/AUTIBSPPC
- PACIASPPC/PACIBSPPC
- PACNBIASPPC/PACNBIBSPPC
- RETAASPPC/RETABSPPC
- PACM

Documentation for these instructions can be found here:
https://developer.arm.com/documentation/ddi0602/2023-09/Base-Instructions/
2023-12-21 14:18:33 +00:00
Lucas Duarte Prates
d43fc5a6ad Reland: [AArch64] Assembly support for the Checked Pointer Arithmetic Extension (#73777)
This introduces assembly support for the Checked Pointer Arithmetic
Extension (FEAT_CPA), annouced as part of the Armv9.5-A architecture
version.

The changes include:
* New subtarget feature for FEAT_CPA
* New scalar instruction for pointer arithmetic
  * ADDPT, SUBPT, MADDPT, and MSUBPT
* New SVE instructions for pointer arithmetic
  * ADDPT (vectors, predicated), ADDPT (vectors, unpredicated)
  * SUBPT (vectors, predicated), SUBPT (vectors, unpredicated)
  * MADPT and MLAPT
* New ID_AA64ISAR3_EL1 system register

Mode details about the extension can be found at:
* https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-developments-2023
* https://developer.arm.com/documentation/ddi0602/2023-09/

Co-authored-by: Rodolfo Wottrich <rodolfo.wottrich@arm.com>
2023-12-20 15:43:17 +00:00
Kazu Hirata
586ecdf205
[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.
2023-12-11 21:01:36 -08:00
Kirill Stoimenov
b6d0ee056d Revert HWASAN failure (#74163)
This is the failure:
https://lab.llvm.org/buildbot/#/builders/236/builds/7728/steps/10/logs/stdio

This started with eef8e1d206dc01c081a0ca29b7f9e0c39d33446e, but because
there were a couple of patches that came after that I had to revert all
3 of them because of merge conflicts.
2023-12-02 04:39:14 +00:00
Lucas Duarte Prates
eef8e1d206
[AArch64] Assembly support for the Checked Pointer Arithmetic Extension (#73777)
This introduces assembly support for the Checked Pointer Arithmetic
Extension (FEAT_CPA), annouced as part of the Armv9.5-A architecture
version.

The changes include:
* New subtarget feature for FEAT_CPA
* New scalar instruction for pointer arithmetic
  * ADDPT, SUBPT, MADDPT, and MSUBPT
* New SVE instructions for pointer arithmetic
  * ADDPT (vectors, predicated), ADDPT (vectors, unpredicated)
  * SUBPT (vectors, predicated), SUBPT (vectors, unpredicated)
  * MADPT and MLAPT
* New ID_AA64ISAR3_EL1 system register

Mode details about the extension can be found at:
* https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-developments-2023
* https://developer.arm.com/documentation/ddi0602/2023-09/

Co-authored-by: Rodolfo Wottrich <rodolfo.wottrich@arm.com>
2023-11-30 10:08:12 +00:00
Matthew Devereau
cdf6693f07
[AArch64][SME] Add support for sme-fa64 (#70809) 2023-11-20 08:37:52 +00:00
Lucas Duarte Prates
59b2301508
[AArch64] Introduce the Armv9.5-A architecture version (#72392)
This introduces the Armv9.5-A architecture version, including the
relevant command-line option for -march.

Mode details about the Armv9.5-A architecture version can be found at:
*
https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-developments-2023
* https://developer.arm.com/documentation/ddi0602/2023-09/

Patch by Oliver Stannard.
2023-11-16 15:38:32 +00:00
Billy Laws
825e4ae732
[AArch64][Windows] Add MC support for ec_context (#69520)
ARM64EC uses the same CONTEXT structure as x86_64 as opposed to the
regular ARM64 context, a new unwind MSFT_OP_EC_CONTEXT is added to
handle this.
2023-11-16 12:21:12 +01:00
Hassnaa Hamdi
f6ca0ed038
[llvm][AArch64][Assembly]: Add SME_F8F16 and SME_F8F32 Ass/Disass. (#70640)
This patch adds the feature flags of SME_F8F16 and SME_F8F32,
 and the assembly/disassembly for the following instructions of SME2:

  * SME:
    - FMLAL, FMLALL
    - FVDOT, FVDOTT
    - FVDOTB 
    - FMOPA
   
That is according to this documentation:
https://developer.arm.com/documentation/ddi0602/2023-09

Co-authored-by: Caroline Concatto <caroline.concatto@arm.com>
2023-11-03 15:00:54 +00:00
Kazu Hirata
e6c0e8565c [AArch64] Fix a warning
This patch fixes:

  llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp:4575:16:
  error: 'ParseStatus' is deprecated: Migrate to ParseStatus
  [-Werror,-Wdeprecated-declarations]
2023-11-02 12:44:01 -07:00
Hassnaa Hamdi
835c885ddb
[llvm][AArch64][Assembly]: Add LUT assembly/disassembly. (#70802)
This patch adds the feature flags of LUT and SME_LUTv2, and the
assembly/disassembly
for the following instructions of NEON, SVE2 and SME2:
  * NEON: 
    - LUT2
    - LUT4
  * SVE2:
    - LUTI2_ZZZI
    - LUTI4_ZZZI 
    - LUTI4_Z2ZZI
  * SME: 
     - MOVT
     - LUTI4_4ZZT2Z
     - LUTI4_S_4ZZT2Z

That is according to this documentation:
https://developer.arm.com/documentation/ddi0602/2023-09
2023-11-02 17:17:20 +00:00
hassnaaHamdi
f16b7c62ac
[llvm][AArch64][Assembly]: Add FDOT2/FDOT4 assembly and disassembly. (#70237)
This patch adds the feature flag FDOT2/FDOT4 and the
assembly/disassembly
for the following instructions of NEON and SVE2:
 * NEON:
   - FDOTlane
   - FDOT
 * SVE2:
   - FDOT_ZZZI_BtoH
   - FDOT_ZZZ_BtoH
   - FDOT_ZZZI_BtoS
   - FDOT_ZZZ_BtoS

That is according to this documentation:
https://developer.arm.com/documentation/ddi0602/2023-09
2023-11-01 16:40:42 +00:00
hassnaaHamdi
6477b41a0b
[llvm][AArch64][Assembly]: Add FP8FMA assembly and disassembly. (#70134)
This patch adds the feature flag FP8FMA and the assembly/disassembly
for the following instructions of NEON and SVE2:
  * NEON: 
    - FMLALBlane
    - FMLALTlane
    - FMLALLBBlane
    - FMLALLBTlane
    - FMLALLTBlane
    - FMLALLTTlane
    - FMLALB
    - FMLALT
    - FMLALLB
    - FMLALLBT
    - FMLALLTB
    - FMLALLTT
  * SVE2:
    - FMLALB_ZZZI
    - FMLALT_ZZZI
    - FMLALB_ZZZ 
    - FMLALT_ZZZ 
    - FMLALLBB_ZZZI 
    - FMLALLBT_ZZZI 
    - FMLALLTB_ZZZI 
    - FMLALLTT_ZZZI 
    - FMLALLBB_ZZZ 
    - FMLALLBT_ZZZ 
    - FMLALLTB_ZZZ 
    - FMLALLTT_ZZZ

That is according to this documentation:
https://developer.arm.com/documentation/ddi0602/2023-09
2023-11-01 13:03:00 +00:00
hassnaaHamdi
b23426ee0e
[LLVM][AArch64][Assembly]: Add FAMINMAX assembly/disasse… (#70115)
…mbly.

This patch adds the feature flag FAMINMAX and the assembly/disassembly
for the following instructions of NEON, SVE2 and SME2:
* NEON:
  - FAMIN
  - FAMAX
* SVE2:
  - FAMIN_ZPmZ
  - FAMAX_ZPmZ
* SME2:
  - FAMAX_2Z2Z
  - FAMIN_2Z2Z
  - FAMAX_4Z4Z
  - FAMIN_4Z4Z

That is according to this documentation:
https://developer.arm.com/documentation/ddi0602/2023-09

Co-authored-by: Caroline Concatto <caroline.concatto@arm.com>
2023-10-27 12:13:46 +01:00
hassnaaHamdi
78941e1eed
[llvm][AArch64][Assembly]: Add FP8 instructions assembly and disassembly. (#69632)
This patch adds the feature flag FP8 and the assembly/disassembly
for the following instructions of NEON, SVE2 and SME2:
  * NEON Instructions:
    + Advanced SIMD two-register miscellaneous:
      - F1CVTL, F1CVTL2, F2CVTL, F2CVTL2 
      - BF1CVTL, BF1CVTL2, BF2CVTL, BF2CVTL2
    + Advanced SIMD three-register extension:
       - FCVTN, FCVTN2 (FP32 to FP8) 
       - FCVTN (FP16 to FP8)
    + Advanced SIMD three same:
      - FSCALE
  * SVE2 Instructions:
    + Downconvert instructions:
       - FCVTN_Z2Z_HtoB
       - FCVTNB_Z2Z_StoB 
       - BFCVTN_Z2Z_HtoB 
       - FCVTNT_Z2Z_StoB
     + Upconvert instructions:
          - F1CVT_ZZ, F2CVT_ZZ
          - BF1CVT_ZZ, BF2CVT_ZZ
          - F1CVTLT_ZZ, F2CVTLT_ZZ 
          - BF1CVTLT_ZZ, BF2CVTLT_ZZ

  * SME2 Instructions:
    - F1CVT_2ZZ, F2CVT_2ZZ
    - BF1CVT_2ZZ, BF2CVT_2ZZ
    - F1CVTL_2ZZ, F2CVTL_2ZZ
    - BF1CVTL_2ZZ, BF2CVTL_2ZZ
    - FCVT_Z2Z_HtoB, BFCVT_Z2Z_HtoB
    - FCVT_Z4Z - FCVTN_Z4Z
    - FSCALE_2ZZ, FSCALE_4ZZ
    - FSCALE_2Z2Z, FSCALE_4Z4Z

That is according to this documentation:
https://developer.arm.com/documentation/ddi0602/2023-09
2023-10-26 16:09:59 +01:00
hassnaaHamdi
17baba9fa2
[llvm][AArch64][Assembly] Implement support to read/write FPMR (#69618)
Also add  Read only registers:
   ID_AA64FPFR0_EL1
   ID_AA64ISAR3_EL1

This is based on this documentation:
https://developer.arm.com/documentation/ddi0602/2023-09

Co-authored-by: Caroline Concatto <caroline.concatto@arm.com>
2023-10-20 16:20:12 +01:00
Kazu Hirata
b2e487d1f9 [llvm] Use StringRef::contains (NFC) 2023-10-18 17:38:37 -07:00
CarolineConcatto
e4e02e31c2
[AArch64][NFC] Refactor NEON, SVE and SME classes and multiclasses fo… (#68800)
…r the assembly disassembly

This NFC patch refactors the assembly/disassembly class and multiclass
in the AArch64 backend to receive a new 2023/09 AArch64[1] ISA release.
The encoding for the 2023 instructions re-uses encoding blocks from
previous assembly/disassembly instructions.
The refactoring makes the class and multiclass for assembly/disassembly
generic so it can be used to describe the instructions for the new ISA.

[1]https://developer.arm.com/documentation/ddi0602/2023-09
2023-10-13 14:25:42 +01:00
Matthew Devereau
b967f3a1d7
[AArch64] Separate PNR into its own Register Class (#65306)
This patch separates PNR registers into their own register class instead
of sharing a register class with PPR registers. This primarily allows us
to return more accurate register classes when applying assembly
constraints, but also more protection from supplying an incorrect
predicate type to an invalid register operand.
2023-09-21 19:53:16 +01:00
Sergei Barannikov
a479be0f39 [MC] Change tryParseRegister to return ParseStatus (NFC)
This finishes the work of replacing OperandMatchResultTy with
ParseStatus, started in D154101.
As a drive-by change, rename some RegNo variables to just Reg
(a leftover from the days when RegNo had 'unsigned' type).
2023-09-06 10:28:12 +03:00
Daniil Kovalev
56ad9e9171 [AArch64][ELF] Support R_AARCH64_AUTH_ABS64 static relocation
The patch adds parser, MCExpr, and emitter support for the authenticated
pointer auth relocation.

In assembly, this is expressed using:
  .quad <symbol>@AUTH(<key>, <discriminator> [, addr])
For example:
  .quad _g3@AUTH(ib, 1234, addr)

The optional 'addr' specifier represents whether the generated pointer
authentication code will also include address diversity (by blending the
address of the storage location of the relocated pointer with the
user-specified constant discriminator).

The @AUTH expression lowers to R_AARCH64_AUTH_ABS64 ELF relocation.

The signing schema is encoded in the place of relocation to be applied
as follows:

```
| 63                | 62 | 61:60 | 59:48 |  47:32        | 31:0   |
| ----------------- | -- | ----- | ----- | ------------- | ------ |
| address diversity | 0  | key   | 0     | discriminator | addend |
```

See the following for details:
https://github.com/ARM-software/abi-aa/blob/main/pauthabielf64/pauthabielf64.rst#static-relocations

Differential Revision: https://reviews.llvm.org/D156505

Co-authored-by: Ahmed Bougacha <ahmed@bougacha.org>
Co-authored-by: Peter Collingbourne <peter@pcc.me.uk>
2023-08-24 18:58:06 +03:00
Sergei Barannikov
b31be75ff4 [AArch64] Replace OperandMatchResultTy with ParseStatus (NFC)
ParseStatus is slightly more convenient to use due to implicit
conversion from bool, which allows to do something like:
```
  return Error(L, "msg");
```
when with MatchOperandResultTy it had to be:
```
  Error(L, "msg");
  return MatchOperand_ParseFail;
```
It also has more appropriate name since parse* methods are not only for
parsing operands.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D154292
2023-07-14 02:21:45 +03:00
Job Noorman
8de9f2b558 Move SubtargetFeature.h from MC to TargetParser
SubtargetFeature.h is currently part of MC while it doesn't depend on
anything in MC. Since some LLVM components might have the need to work
with target features without necessarily needing MC, it might be
worthwhile to move SubtargetFeature.h to a different location. This will
reduce the dependencies of said components.

Note that I choose TargetParser as the destination because that's where
Triple lives and SubtargetFeatures feels related to that.

This issues came up during a JITLink review (D149522). JITLink would
like to avoid a dependency on MC while still needing to store target
features.

Reviewed By: MaskRay, arsenm

Differential Revision: https://reviews.llvm.org/D150549
2023-06-26 11:20:08 +02:00
David Green
2802739dfd [NFC] Replace ;; with ; 2023-06-11 10:25:24 +01:00
Martin Storsjö
a499d675ae [AArch64] Make .arch without extra features actually take effect
This fixes PR32873 / https://github.com/llvm/llvm-project/issues/32220.

Differential Revision: https://reviews.llvm.org/D151982
2023-06-06 11:50:04 +03:00
Martin Storsjö
4b8d9abca7 [AArch64] Complete the list of extensions supported by .arch and .arch_extension
This brings the list of extensions supported here up to date
with what is supported by current git versions of binutils.

Also add a comment to AArch64TargetParser to remind people to
consider adding new ones to the list supported in assembly.

In the case of the "rdma" extension, there's a slight surprise:
LLVM knows of the extension under the name "rdm", while binutils
has it named "rdma". However, binutils appears to accept any
abbreviated prefix of an arch extension, so it does accept the
form "rdm" too even if it formally considers it called "rdma".

Support both spellings for the extensions here, for simplicity.

Differential Revision: https://reviews.llvm.org/D151981
2023-06-06 11:50:03 +03:00
Kazu Hirata
d035489297 [AArch64] Remove unused declaration tryParseMRSSystemRegister
The corresponding definition was removed by:

  commit e8b4166accfa03b9693bea34e53eb384f4b99198
  Author: Bradley Smith <bradley.smith@arm.com>
  Date:   Wed Apr 9 14:43:06 2014 +0000
2023-05-29 10:53:46 -07:00
Kazu Hirata
6c3ea866e9 [llvm] Migrate {starts,ends}with_insensitive to {starts,ends}_with_insensitive (NFC)
This patch migrates uses of StringRef::{starts,ends}with_insensitive
to StringRef::{starts,ends}_with_insensitive so that we can use names
similar to those used in std::string_view.  I'm planning to deprecate
StringRef::{starts,ends}with_insensitive once the migration is
complete across the code base.

Differential Revision: https://reviews.llvm.org/D150426
2023-05-12 15:37:37 -07:00
Caroline Concatto
ffa0a2ecd4 [AArch64][SME] Fix LDR and STR asm parser
The LDR and STR instructions must have the same value for imm4(second operand)
and offset(fourth operand).
The disassembly guarantees that happens, but the Asm parser was not checking that.
This patch fixes that by checking if the second operand and fourth operand are
immediate and have the same value.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D147617
2023-04-06 11:04:49 +00:00
Archibald Elliott
6194446962 [AArch64] Add Missing Custom Target Operands
I noticed, when examining the generated Asm Matcher table, that some of
these custom immediate operands are missing, and so we are not parsing
some hint aliases into the correct MCInst.

Where this becomes apparent is when you parse e.g. `hint #7` into an
MCInst - without these cases, it becomes the MCInst `(HINT 17)`, which
will always be printed as `hint #17`. With these cases, it becomes the
MCInst `XPACLRI`, which will be printed as `xpaclri` with pauth, or
`hint #17` without, matching how `xpaclri` is parsed.

We only handle some specific hint aliases in this manner, usually where
these hints have specific effects that need to be modelled for accurate
code-generation. Otherwise, we just use the normal `InstAlias` system
to have the aliases parsed into a `(HINT N)` MCInst.

Differential Revision: https://reviews.llvm.org/D146630
2023-03-23 15:14:07 +00:00
Archibald Elliott
cb7fb73785 [AArch64] Assembly Support for FEAT_GCS/FEAT_CHK
This implements support for two new 2022 A-profile extensions:
- FEAT_CHK - Check Feature Status Extension
- FEAT_GCS - Guarded Control Stacks

FEAT_CHK is mandatory from armv8.0-a, but is in the hint space so
there's no clang command-line flag for it, and we only print the hint as
`chkfeat x16` at v8.9a and above, to be compatible when using a
non-integrated assembler that might not yet know about the extension.

FEAT_GCS is optional from armv9.4-a onwards. It is enabled using `+gcs`
in a clang `-march=` or `-mcpu=` option string, or using a
`.arch_extension gcs` assembly directive.

This patch includes changes by Ties Stuij, Tomas Matheson, and Keith
Walker.

Differential Revision: https://reviews.llvm.org/D145563
2023-03-15 11:03:53 +00:00
Archibald Elliott
4679d7a26a [NFC][ARM][AArch64] Cleanup TargetParser includes
llvm/TargetParser/TargetParser.h now only includes AMDGPU-specific
functionality, the ARM- and AArch64-specific functionality is in other
headers.
2023-03-03 16:24:55 +00:00
Fangrui Song
d9e4c10440 [AArch64] Simplify with MCSubtargetInfo::hasFeature. NFC 2023-02-17 14:29:21 -08:00
Archibald Elliott
8e3d7cf5de [NFC][TargetParser] Remove llvm/Support/TargetParser.h 2023-02-07 11:08:21 +00:00
Archibald Elliott
8c712296fb [NFC][TargetParser] Remove llvm/Support/AArch64TargetParser.h
Removes the forwarding header `llvm/Support/AArch64TargetParser.h`.

I am proposing to do this for all the forwarding headers left after
rGf09cf34d00625e57dea5317a3ac0412c07292148 - for each header:
- Update all relevant in-tree includes
- Remove the forwarding Header

Differential Revision: https://reviews.llvm.org/D140999
2023-02-03 17:34:01 +00:00
Kazu Hirata
e078201835 [Target] Use llvm::count{l,r}_{zero,one} (NFC) 2023-01-28 09:23:07 -08:00
Lucas Prates
0753cf2cac [NFC][AArch64] Get default features directly from ArchInfo and CpuInfo objects
This updates the AArch64's Target Parser and its uses to capture
information about default features directly from ArchInfo and CpuInfo
objects, instead of relying on an API function to access them
indirectly.

Reviewed By: tmatheson

Differential Revision: https://reviews.llvm.org/D142540
2023-01-27 12:37:18 +00:00