llvm-project/clang/test/Preprocessor/riscv-target-features-andes.c
Jim Lin 22707fd4a5
[RISCV] Add Andes XAndesBFHCvt (Andes Scalar BFLOAT16) extension (#148563)
The spec can be found at:

https://github.com/andestech/andes-v5-isa/releases/tag/ast-v5_4_0-release.

The extension includes only two instructions: one for converting from
f32 to f16, and another for converting from f16 to f32.

This patch only implements MC support for XAndesBFHCvt.
2025-07-15 08:59:00 +08:00

60 lines
2.5 KiB
C

// RUN: %clang --target=riscv32-unknown-linux-gnu -march=rv32i -E -dM %s \
// RUN: -o - | FileCheck %s
// RUN: %clang --target=riscv64-unknown-linux-gnu -march=rv64i -E -dM %s \
// RUN: -o - | FileCheck %s
// CHECK-NOT: __riscv_xandesperf {{.*$}}
// CHECK-NOT: __riscv_xandesbfhcvt {{.*$}}
// CHECK-NOT: __riscv_xandesvbfhcvt {{.*$}}
// CHECK-NOT: __riscv_xandesvsintload {{.*$}}
// CHECK-NOT: __riscv_xandesvpackfph {{.*$}}
// CHECK-NOT: __riscv_xandesvdot {{.*$}}
// RUN: %clang --target=riscv32 \
// RUN: -march=rv32i_xandesperf -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-XANDESPERF %s
// RUN: %clang --target=riscv64 \
// RUN: -march=rv64i_xandesperf -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-XANDESPERF %s
// CHECK-XANDESPERF: __riscv_xandesperf 5000000{{$}}
// RUN: %clang --target=riscv32 \
// RUN: -march=rv32i_xandesbfhcvt -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-XANDESBFHCVT %s
// RUN: %clang --target=riscv64 \
// RUN: -march=rv64i_xandesbfhcvt -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-XANDESBFHCVT %s
// CHECK-XANDESBFHCVT: __riscv_xandesbfhcvt 5000000{{$}}
// RUN: %clang --target=riscv32 \
// RUN: -march=rv32i_xandesvbfhcvt -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-XANDESVBFHCVT %s
// RUN: %clang --target=riscv64 \
// RUN: -march=rv64i_xandesvbfhcvt -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-XANDESVBFHCVT %s
// CHECK-XANDESVBFHCVT: __riscv_xandesvbfhcvt 5000000{{$}}
// RUN: %clang --target=riscv32 \
// RUN: -march=rv32i_xandesvsintload -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-XANDESVSINTLOAD %s
// RUN: %clang --target=riscv64 \
// RUN: -march=rv64i_xandesvsintload -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-XANDESVSINTLOAD %s
// CHECK-XANDESVSINTLOAD: __riscv_xandesvsintload 5000000{{$}}
// RUN: %clang --target=riscv32 \
// RUN: -march=rv32i_xandesvpackfph -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-XANDESVPACKFPH %s
// RUN: %clang --target=riscv64 \
// RUN: -march=rv64i_xandesvpackfph -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-XANDESVPACKFPH %s
// CHECK-XANDESVPACKFPH: __riscv_xandesvpackfph 5000000{{$}}
// RUN: %clang --target=riscv32 \
// RUN: -march=rv32i_xandesvdot -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-XANDESVDOT %s
// RUN: %clang --target=riscv64 \
// RUN: -march=rv64i_xandesvdot -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-XANDESVDOT %s
// CHECK-XANDESVDOT: __riscv_xandesvdot 5000000{{$}}