commit b7453e120671eee518994655b0a6db41b673f099
parent e488f767665bf4f1ad5231b1b092ec55f0aebbf1
Author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
Date: Sun, 26 Dec 2021 14:31:24 +0100
ppu aarch64: sorry, neauoire
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/devices/ppu_aarch64.c b/src/devices/ppu_aarch64.c
@@ -1,3 +1,4 @@
+#ifdef __aarch64__
#include <arm_neon.h>
#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