Skip to content

Elementwise builtins are not constexpr #57905

Closed as not planned
Closed as not planned
@RKSimon

Description

@RKSimon

https://simd.godbolt.org/z/E4KcoTfdP

typedef int __v4si __attribute__((__vector_size__(16)));
constexpr __v4si minmax(__v4si x, __v4si y) {
    return __builtin_elementwise_max(x, y);
}

clang -g0 -O3

<source>:3:18: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
constexpr __v4si minmax(__v4si x, __v4si y) {
                 ^
<source>:4:12: note: subexpression not valid in a constant expression
    return __builtin_elementwise_max(x, y);

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:codegenIR generation bugs: mangling, exceptions, etc.duplicateResolved as duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions