gallium/radeon: clean left-shift undefined behavior
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sat, 30 Apr 2016 03:15:48 +0000 (22:15 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Sat, 7 May 2016 21:46:59 +0000 (16:46 -0500)
commit60d2fc233bc7f15120f72119f9af678175a9b40d
tree4e5add7d0a162d04f6ff5d8bd7457f0725ce89bc
parent62b7958cd0ec03ff1e15144f0104728458621d1d
gallium/radeon: clean left-shift undefined behavior

Shifting into the sign bit of a signed int is undefined behavior.
Unfortunately, there are potentially many places where this happens using
the register macros.

This commit is the result of running

sed -ie "s/(((\(\w\+\)) & 0x\(\w\+\)) << \(\w\+\))/(((unsigned)(\1) \& 0x\2) << \3)/g"

on all header files in gallium/{r600,radeon,radeonsi}.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/r600/eg_sq.h
src/gallium/drivers/r600/evergreend.h
src/gallium/drivers/r600/r600_opcodes.h
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_sq.h
src/gallium/drivers/r600/r600d.h
src/gallium/drivers/r600/r700_sq.h
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeon/r600d_common.h
src/gallium/drivers/radeon/radeon_uvd.h
src/gallium/drivers/radeonsi/sid.h