8000 riscv_vector.h intrinsics should be target-gated, not preprocessor-gated · Issue #56592 · llvm/llvm-project · GitHub
[go: up one dir, main page]

Skip to content
riscv_vector.h intrinsics should be target-gated, not preprocessor-gated #56592
Closed
@malaterre

Description

@malaterre

This is a complete duplicate of issue #56480 but for riscv-64.

Clang's intrinsics headers on Riscv-64 contain code like:

% head -20 /usr/lib/llvm-14/lib/clang/14.0.6/include/riscv_vector.h | tail -5

#ifndef __riscv_vector
#error "Vector intrinsics require the vector extension."
#endif

This means that one can only use Riscv-64 intrinsics in TUs that mark the feature as available for the entire intrinsic, e.g. via -march flags. In contrast, the x86 intrinsics are consistently defined, but tagged with __attribute__((__target__("whatever"))):

See also:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0