From b7453e120671eee518994655b0a6db41b673f099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Sun, 26 Dec 2021 14:31:24 +0100 Subject: [PATCH] ppu aarch64: sorry, neauoire --- src/devices/ppu_aarch64.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/devices/ppu_aarch64.c b/src/devices/ppu_aarch64.c index d33db23..fb7470e 100644 --- a/src/devices/ppu_aarch64.c +++ b/src/devices/ppu_aarch64.c @@ -1,3 +1,4 @@ +#ifdef __aarch64__ #include #include "ppu.h" @@ -11,6 +12,12 @@ ppu_redraw(Ppu *p, Uint32 *screen) p->fg.changed = p->bg.changed = 0; +#ifdef __has_builtin +#if __has_builtin(__builtin_assume) + __builtin_assume(p->width > 0 && p->height > 0); +#endif +#endif + for(i = 0; i < (p->width * p->height & ~15); i += 16, fg += 16, bg += 16, screen += 16) { uint8x16_t fg8 = vld1q_u8(fg); uint8x16_t bg8 = vld1q_u8(bg); @@ -27,3 +34,4 @@ ppu_redraw(Ppu *p, Uint32 *screen) for(; i < p->width * p->height; i++) screen[i] = p->palette[*fg ? *fg : *bg]; } +#endif