mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-02 11:51:25 +00:00
Split the initialization of the pragma.h's libdivide tables into its own function.
git-svn-id: https://svn.eduke32.com/eduke32@5362 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
ed734ccd98
commit
ff416551ce
3 changed files with 16 additions and 9 deletions
|
@ -43,6 +43,7 @@ extern int32_t reciptable[2048], fpuasm;
|
|||
|
||||
extern libdivide_s64pad_t divtable64[DIVTABLESIZE];
|
||||
extern libdivide_s32pad_t divtable32[DIVTABLESIZE];
|
||||
extern void initdivtables(void);
|
||||
|
||||
#if defined(__arm__) || defined(LIBDIVIDE_ALWAYS)
|
||||
static inline uint32_t divideu32(uint32_t n, uint32_t d)
|
||||
|
|
|
@ -8178,18 +8178,10 @@ static int32_t loadtables(void)
|
|||
if (tablesloaded == 0)
|
||||
{
|
||||
int32_t i;
|
||||
libdivide_s64_t d;
|
||||
libdivide_s32_t d32;
|
||||
|
||||
initksqrt();
|
||||
|
||||
for (i=1; i<DIVTABLESIZE; i++)
|
||||
{
|
||||
d = libdivide_s64_gen(i);
|
||||
divtable64[i].magic = d.magic, divtable64[i].more = d.more;
|
||||
d32 = libdivide_s32_gen(i);
|
||||
divtable32[i].magic = d32.magic, divtable32[i].more = d32.more;
|
||||
}
|
||||
initdivtables();
|
||||
|
||||
for (i=0; i<2048; i++)
|
||||
reciptable[i] = divscale30(2048, i+2048);
|
||||
|
|
|
@ -13,6 +13,20 @@
|
|||
libdivide_s64pad_t divtable64[DIVTABLESIZE];
|
||||
libdivide_s32pad_t divtable32[DIVTABLESIZE];
|
||||
|
||||
void initdivtables(void)
|
||||
{
|
||||
libdivide_s64_t d;
|
||||
libdivide_s32_t d32;
|
||||
|
||||
for (int i=1; i<DIVTABLESIZE; i++)
|
||||
{
|
||||
d = libdivide_s64_gen(i);
|
||||
divtable64[i].magic = d.magic, divtable64[i].more = d.more;
|
||||
d32 = libdivide_s32_gen(i);
|
||||
divtable32[i].magic = d32.magic, divtable32[i].more = d32.more;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t divideu32_noinline(uint32_t n, uint32_t d) { return divideu32(n, d); }
|
||||
int32_t tabledivide32_noinline(int32_t n, int32_t d) { return tabledivide32(n, d); }
|
||||
int32_t tabledivide64_noinline(int64_t n, int32_t d) { return tabledivide64(n, d); }
|
||||
|
|
Loading…
Reference in a new issue