ppu aarch64: sorry, neauoire

This commit is contained in:
Sigrid Solveig Haflínudóttir 2021-12-26 14:31:24 +01:00
parent e488f76766
commit b7453e1206
1 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,4 @@
#ifdef __aarch64__
#include <arm_neon.h> #include <arm_neon.h>
#include "ppu.h" #include "ppu.h"
@ -11,6 +12,12 @@ ppu_redraw(Ppu *p, Uint32 *screen)
p->fg.changed = p->bg.changed = 0; 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) { 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 fg8 = vld1q_u8(fg);
uint8x16_t bg8 = vld1q_u8(bg); uint8x16_t bg8 = vld1q_u8(bg);
@ -27,3 +34,4 @@ ppu_redraw(Ppu *p, Uint32 *screen)
for(; i < p->width * p->height; i++) for(; i < p->width * p->height; i++)
screen[i] = p->palette[*fg ? *fg : *bg]; screen[i] = p->palette[*fg ? *fg : *bg];
} }
#endif