[PATCH] D81304: [llvm][SveEmitter] Emit the bfloat version of `svld1ro`.

Francesco Petrogalli via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 16 13:12:28 PDT 2020


fpetrogalli added inline comments.


================
Comment at: clang/include/clang/Basic/AArch64SVEACLETypes.def:44
 #define SVE_VECTOR_TYPE(Name, MangledName, Id, SingletonId, NumEls, ElBits,    \
-                        IsSigned, IsFP)                                        \
+                        IsSigned, IsFP, IsBF)                                \
   SVE_TYPE(Name, Id, SingletonId)
----------------
sdesmalen wrote:
> nit: odd formatting (of the last `\`), did you use clang-format?
Yes, but `def` files are left untouched. I fixed it.


================
Comment at: clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_ld1ro-bfloat.c:1
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE_MATMUL_FP64 -D__ARM_FEATURE_BF16_SCALAR_ARITHMETIC -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +bf16 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE_MATMUL_FP64 -D__ARM_FEATURE_BF16_SCALAR_ARITHMETIC -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +bf16 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
----------------
sdesmalen wrote:
> stuij wrote:
> > There should be no dependency on `-fallow-half-arguments-and-returns`. For bfloat we should use `-mfloat-abi hard`. Does this work for `-mfloat-abi softfp`?
> `-fallow-half-arguments-and-returns` isn't strictly needed for this test, we just use the same RUN line for all the ACLE tests and we needed this for `__fp16` in some of the tests.
> 
> I don't believe that `-mfloat-abi softfp` is supported for AArch64.
@stuij - the following lines work, one with `softfp` and one with `hard`:

```
// RUN: %clang_cc1 -D__ARM_FEATURE_SVE_MATMUL_FP64 -D__ARM_FEATURE_BF16_SCALAR_ARITHMETIC -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -target\
-feature +bf16 -mfloat-abi softfp -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -D__ARM_FEATURE_SVE_MATMUL_FP64 -D__ARM_FEATURE_BF16_SCALAR_ARITHMETIC -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -target\
-feature +bf16 -mfloat-abi hard -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
```

@sdesmalen I am not an experer here, but there is a test which targets aarch64 that uses `softfp` (see `clang/test/CodeGen/arm-bf16-params-returns.c`). The following line in that test clearly targets `aarch64`:

```
// RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs -mfloat-abi softfp -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -mem2reg -sroa | FileCheck %s \
--check-prefix=CHECK64-SOFTFP
```

@both - should I update the test with the two extra RUN lines mentioned up in the message?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81304/new/

https://reviews.llvm.org/D81304





More information about the cfe-commits mailing list