Skip to content

Commit

Permalink
[Clang][XTHeadVector] define __riscv_vector (ruyisdk#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
imkiva committed Aug 30, 2024
1 parent 94384bb commit 3fbbdcd
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 @@ -230,6 +230,7 @@
// RUN: -o - | FileCheck --check-prefix=CHECK-V0P7-EXT %s
// CHECK-V0P7-EXT: __riscv_th_v_intrinsic 11000{{$}}
// CHECK-V0P7-EXT: __riscv_xtheadvector 1000000{{$}}
// CHECK-V0P7-EXT: __riscv_vector 1

// RUN: %clang -target riscv32-unknown-linux-gnu \
// RUN: -march=rv32i_xtheadvector -x c -E -dM %s \
Expand Down

0 comments on commit 3fbbdcd

Please sign in to comment.