lima/ppir: refactor bitcopy to use unsigned char

This code does not work as expected when built with clang and
-fstrict-aliasing.
Redefine it in unsigned char operations so that it does not
violate strict aliasing rules.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Cc: 22.0 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14894>
This commit is contained in:
Erico Nunes 2022-02-05 11:14:36 +01:00 committed by Marge Bot
parent 7297f931f0
commit 0f9756f480

View file

@ -713,13 +713,13 @@ static int get_instr_encode_size(ppir_instr *instr)
static void bitcopy(void *dst, int dst_offset, void *src, int src_size)
{
int off1 = dst_offset & 0x1f;
uint32_t *cpy_dst = dst, *cpy_src = src;
unsigned char *cpy_dst = dst, *cpy_src = src;
int off1 = dst_offset & 0x07;
cpy_dst += (dst_offset >> 5);
cpy_dst += (dst_offset >> 3);
if (off1) {
int off2 = 32 - off1;
int off2 = 0x08 - off1;
int cpy_size = 0;
while (1) {
*cpy_dst |= *cpy_src << off1;