Files
ppsspp/math/math_util.cpp

54 lines
796 B
C++
Raw Normal View History

2012-05-09 00:33:43 +02:00
#include "math/math_util.h"
#include <math.h>
#include <stdlib.h>
/*
2012-10-30 13:20:55 +01:00
static unsigned int randSeed = 22222; // Change this for different random sequences.
2012-05-09 00:33:43 +02:00
void SetSeed(unsigned int seed) {
randSeed = seed * 382792592;
}
unsigned int GenerateRandomNumber() {
randSeed = (randSeed * 196314165) + 907633515;
randSeed ^= _rotl(randSeed, 13);
return randSeed;
}*/
#include <math.h>
2013-03-21 20:51:35 +01:00
#if defined(ARMV7)
2012-05-09 00:33:43 +02:00
void EnableFZ()
{
2012-10-30 13:20:55 +01:00
int x;
asm(
"fmrx %[result],FPSCR \r\n"
"orr %[result],%[result],#16777216 \r\n"
"fmxr FPSCR,%[result]"
:[result] "=r" (x) : :
);
//printf("ARM FPSCR: %08x\n",x);
2012-05-09 00:33:43 +02:00
}
void DisableFZ( )
{
2012-10-30 13:20:55 +01:00
__asm__ volatile(
"fmrx r0, fpscr\n"
"bic r0, $(1 << 24)\n"
"fmxr fpscr, r0" : : : "r0");
2012-05-09 00:33:43 +02:00
}
#else
void EnableFZ()
{
2013-03-21 20:51:35 +01:00
// TODO
2012-05-09 00:33:43 +02:00
}
2013-03-21 20:51:35 +01:00
2012-05-09 00:33:43 +02:00
void DisableFZ()
{
2013-03-21 20:51:35 +01:00
// TODO
2012-05-09 00:33:43 +02:00
}
2012-10-30 13:20:55 +01:00
#endif