mesa/src
Juan A. Suarez Romero e43cc49806 nir: fix overflow when negating maxint in constant expressions
Undefined Behaviour Sanitizer (UBSan) detected the following when
running testing `dEQP-VK.graphicsfuzz.cov-fold-negate-min-int-value`:

`negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself`

SPIR-V spec states that OpSNegate(0x80000000) has to return 0x80000000;
in our case, -2147483648 should be -2147483648.

While this is not causing any issue because compilers seem to be
behaving like that, it is still undefined behaviour, so it expects to be
this handled explicitly, which is the purpose of this commit.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29772>
2024-06-21 21:07:05 +00:00
..
amd radv/rra: Enable RADV_RRA_TRACE_COPY_AFTER_BUILD by default 2024-06-21 17:47:53 +00:00
android_stub vulkan/android: Add helper to probe AHB support 2024-05-14 14:53:44 +00:00
asahi treewide: use nir_def_replace sometimes 2024-06-21 15:36:56 +00:00
broadcom treewide: use nir_def_replace sometimes 2024-06-21 15:36:56 +00:00
c11
compiler nir: fix overflow when negating maxint in constant expressions 2024-06-21 21:07:05 +00:00
drm-shim drm-shim: Stub syncobj reset ioctl 2024-05-21 14:14:25 +00:00
egl egl: use os_get_option() to allow android to set EGL_LOG_LEVEL 2024-06-21 07:44:36 +00:00
etnaviv etnaviv: update headers from rnndb 2024-06-12 16:34:30 +00:00
freedreno tu: Drop tu_init_sampler helper function 2024-06-21 19:30:06 +00:00
gallium util: do not access member of a NULL structure 2024-06-21 21:07:05 +00:00
gbm gbm: Support fixed-rate compression allocation 2024-06-12 21:20:06 +00:00
getopt
glx glx: fix build -D glx-direct=false 2024-06-14 16:24:33 +00:00
gtest
imagination treewide: use nir_def_replace sometimes 2024-06-21 15:36:56 +00:00
imgui
intel treewide: use nir_def_replace sometimes 2024-06-21 15:36:56 +00:00
loader loader: use os_get_option() to allow android to set LIBGL_DRIVERS_PATH, GBM_BACKENDS_PATH, GALLIUM_PIPE_SEARCH_DIR 2024-06-21 07:44:36 +00:00
mapi mapi: add EXT_texture_storage_compression extension 2024-06-12 21:20:06 +00:00
mesa treewide: use nir_def_replace sometimes 2024-06-21 15:36:56 +00:00
microsoft treewide: use nir_def_replace sometimes 2024-06-21 15:36:56 +00:00
nouveau treewide: use nir_def_replace sometimes 2024-06-21 15:36:56 +00:00
panfrost treewide: use nir_def_replace sometimes 2024-06-21 15:36:56 +00:00
tool pps: Config tweaks to avoid loosing traces 2024-03-25 19:49:50 +00:00
util util: use unsigned types when performing bitshift 2024-06-21 21:07:05 +00:00
virtio venus/ci: drop fixed test from fails list 2024-06-21 17:24:32 +00:00
vulkan vulkan: do not access member of a NULL structure 2024-06-21 21:07:05 +00:00
.clang-format asahi: add agx_ppp_push_merged helper 2024-05-14 04:57:27 +00:00
meson.build loader/wayland: Add fallback wl_display_dispatch_queue_timeout 2024-02-27 13:10:13 +00:00