mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Merge pull request #695 from devnexen/arm_runfast_mode
Little optimisation attempt targeted only for ARM 32 bits,
This commit is contained in:
commit
1bae4e679f
1 changed files with 16 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue