mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 11:58:10 +02:00
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:
parent
7297f931f0
commit
0f9756f480
1 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue