mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
if 0 out our klabs() function and just define it as abs()
The compiler generates much better code for this now. git-svn-id: https://svn.eduke32.com/eduke32@7863 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
752cf77887
commit
26272f6755
1 changed files with 6 additions and 2 deletions
|
@ -241,11 +241,15 @@ static FORCE_INLINE CONSTEXPR char readpixel(void *s) { return *(char *)s; }
|
||||||
static FORCE_INLINE void drawpixel(void *s, char a) { *(char *)s = a; }
|
static FORCE_INLINE void drawpixel(void *s, char a) { *(char *)s = a; }
|
||||||
|
|
||||||
#ifndef pragmas_have_klabs
|
#ifndef pragmas_have_klabs
|
||||||
static FORCE_INLINE int32_t klabs(int32_t a)
|
#if 0
|
||||||
|
static FORCE_INLINE int32_t klabs(int32_t const a)
|
||||||
{
|
{
|
||||||
const uint32_t m = a >> (sizeof(uint32_t) * CHAR_BIT - 1);
|
uint32_t const m = a >> (sizeof(uint32_t) * CHAR_BIT - 1);
|
||||||
return (a ^ m) - m;
|
return (a ^ m) - m;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define klabs(x) abs(x)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef pragmas_have_ksgn
|
#ifndef pragmas_have_ksgn
|
||||||
static FORCE_INLINE CONSTEXPR int32_t ksgn(int32_t a) { return (a > 0) - (a < 0); }
|
static FORCE_INLINE CONSTEXPR int32_t ksgn(int32_t a) { return (a > 0) - (a < 0); }
|
||||||
|
|
Loading…
Reference in a new issue