aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python
diff options
context:
space:
mode:
authorFraser Cormack <fraser@codeplay.com>2025-01-29 09:40:04 +0000
committerGitHub <noreply@github.com>2025-01-29 09:40:04 +0000
commit1ac3665e66c7ddb20ef26bc275ad005186ab09fb (patch)
tree8614a57d31b5e5763c9f28e0c3387c85b9fa9274 /lldb/source/Plugins/ScriptInterpreter/Python
parente902cf2df1718b46f83ff132bf4ec5f84b163209 (diff)
downloadllvm-1ac3665e66c7ddb20ef26bc275ad005186ab09fb.zip
llvm-1ac3665e66c7ddb20ef26bc275ad005186ab09fb.tar.gz
llvm-1ac3665e66c7ddb20ef26bc275ad005186ab09fb.tar.bz2
[clang] Restrict the use of scalar types in vector builtins (#119423)
This commit restricts the use of scalar types in vector math builtins, particularly the `__builtin_elementwise_*` builtins. Previously, small scalar integer types would be promoted to `int`, as per the usual conversions. This would silently do the wrong thing for certain operations, such as `add_sat`, `popcount`, `bitreverse`, and others. Similarly, since unsigned integer types were promoted to `int`, something like `add_sat(unsigned char, unsigned char)` would perform a *signed* operation. With this patch, promotable scalar integer types are not promoted to int, and are kept intact. If any of the types differ in the binary and ternary builtins, an error is issued. Similarly an error is issued if builtins are supplied integer types of different signs. Mixing enums of different types in binary/ternary builtins now consistently raises an error in all language modes. This brings the behaviour surrounding scalar types more in line with that of vector types. No change is made to vector types, which are both not promoted and whose element types must match. Fixes #84047. RFC: https://discourse.llvm.org/t/rfc-change-behaviour-of-elementwise-builtins-on-scalar-integer-types/83725
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
0 files changed, 0 insertions, 0 deletions