Skip to content

Commit

Permalink
[Clang][XTHeadVector] define __riscv_vector (#129)
Browse files Browse the repository at this point in the history
* [Clang][XTHeadVector] define `__riscv_vector` (#128)

* [Clang][XTHeadVector] reorder check test
  • Loading branch information
imkiva authored Aug 30, 2024
1 parent 94384bb commit 1170a48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/RISCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ void RISCVTargetInfo::getTargetDefines(const LangOptions &Opts,
if (HasXTHeadVector) {
// https://github.com/riscv-non-isa/rvv-intrinsic-doc/pull/298/files
Builder.defineMacro("__riscv_th_v_intrinsic", Twine(getVersionValue(0, 11)));
// https://github.com/ruyisdk/llvm-project/issues/128
Builder.defineMacro("__riscv_vector");
}

auto VScale = getVScaleRange(Opts);
Expand Down
1 change: 1 addition & 0 deletions clang/test/Preprocessor/riscv-target-features.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
// RUN: -march=rv64i_xtheadvector -x c -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-V0P7-EXT %s
// CHECK-V0P7-EXT: __riscv_th_v_intrinsic 11000{{$}}
// CHECK-V0P7-EXT: __riscv_vector 1
// CHECK-V0P7-EXT: __riscv_xtheadvector 1000000{{$}}

// RUN: %clang -target riscv32-unknown-linux-gnu \
Expand Down

0 comments on commit 1170a48

Please sign in to comment.