Skip to content

Commit

Permalink
[clang][RISCV] __riscv_v_intrinsic macro doesn't need zve32x (#117356)
Browse files Browse the repository at this point in the history
This macro is used to check if compiler supports RVV intrinsics, so it
should be defined no matter vector is enabled or not.
Resolved riscv-non-isa/rvv-intrinsic-doc#376
  • Loading branch information
4vtomat authored Nov 27, 2024
1 parent 38a3cce commit 90a776f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clang/lib/Basic/Targets/RISCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ void RISCVTargetInfo::getTargetDefines(const LangOptions &Opts,
if (ISAInfo->hasExtension("c"))
Builder.defineMacro("__riscv_compressed");

if (ISAInfo->hasExtension("zve32x")) {
if (ISAInfo->hasExtension("zve32x"))
Builder.defineMacro("__riscv_vector");
// Currently we support the v1.0 RISC-V V intrinsics.
Builder.defineMacro("__riscv_v_intrinsic", Twine(getVersionValue(1, 0)));
}

// Currently we support the v1.0 RISC-V V intrinsics.
Builder.defineMacro("__riscv_v_intrinsic", Twine(getVersionValue(1, 0)));

auto VScale = getVScaleRange(Opts);
if (VScale && VScale->first && VScale->first == VScale->second)
Expand Down

0 comments on commit 90a776f

Please sign in to comment.