Merge pull request #695 from devnexen/arm_runfast_mode

Little optimisation attempt targeted only for ARM 32 bits,
This commit is contained in:
Yamagi 2021-04-07 09:32:18 +02:00 committed by GitHub
commit 1bae4e679f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,5 +188,21 @@ void Sys_SetupFPU(void) {
}
#else
void Sys_SetupFPU(void) {
#if defined(__arm__)
// Enable RunFast mode if not enabled already
static const unsigned int bit = 0x04086060;
static const unsigned int fpscr = 0x03000000;
int ret;
asm volatile("fmrx %0, fpscr" : "=r"(ret));
if (ret != fpscr) {
asm volatile("fmrx %0, fpscr\n\t"
"and %0, %0, %1\n\t"
"orr %0, %0, %2\n\t"
"fmxr fpscr, %0"
: "=r"(ret)
: "r"(bit), "r"(fpscr));
}
#endif
}
#endif