2 Commits

Author SHA1 Message Date
Sarah Spall
42004193f4
[HLSL] Add NativeInt16Type langopt to control whether short type is supported. Enabled by default for all but HLSL. (#165584)
Add a new langopt NativeInt16Type to control support for 16 bit
integers.
Enable by default for all languages but HLSL. 
HLSL defines uint16_t and int16_t as a typedef of short. If
-enable-16bit-types is not used, the typedefs don't exist so int16_t and
uint16_t can't be used. However, short was still allowed. This change
will produce an error 'unknown type name short' if -enable-16bit-types
isn't used.
Update failing tests. 
Add new test.
Closes #81779
2025-10-31 09:49:32 -07:00
Chris B
f3cd6b749c
[HLSL] Convert vectors to bool for unary ! (#163857)
HLSL extends C++'s requirement that unary `!` apply to boolean arguments
and produces boolean results to apply to vectors. This change implements
implicit conversion for non-boolean vector operands to boolean vectors.

I've noted this behavior in the issue tracking writing the HLSL
specification section on unary operators
(https://github.com/microsoft/hlsl-specs/issues/686).

Fixes #162913

---------

Co-authored-by: Farzon Lotfi <farzonl@gmail.com>
Co-authored-by: Erich Keane <ekeane@nvidia.com>
2025-10-17 08:42:00 -05:00