codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
float _fsel_branchless(float f, float x, float y) { unsigned int msk, res; msk = -(((*(unsigned int *)&f)>>31)&1); res = ((msk)&*(unsigned int *)&y)|((~msk)&*(unsigned int *)&x); return *(float *)&res; } float _fsel(float f, float x, float y) { return f < 0.0f ? y : x; } /* _fsel_branchess : 3.566362 second(s) _fsel : 4.344463 second(s) */
Private
[
?
]
Run code
Submit