llvm / llvm/llvm-project

[clang] cast operator from ext_vector_type of bool to an integer bitmask

Open
#195,424 1 comment 0 reactions 0 assignees View on GitHub
clang:frontend simd
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Clang lacks an operator for converting SIMD vectors (ext_vector_type) consisting of bool elements to an integer type (and vice versa), for example to unsigned _BitInt(N). In LLVM IR this is done trivially, but in C such an operator does not exist. I propose adding it; currently, one has to use the __builtin_memcpy_inline builtin to do this.

Contributor guide

Open the contributing guide

Research direction

Start at Clang's ext_vector_type cast handling and the __builtin_memcpy_inline workaround; compare the requested C conversion with the corresponding LLVM IR behavior. Done means conversions between bool ext_vector_type vectors and integer bitmasks, including unsigned _BitInt(N), are specified and supported in both directions.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.