mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
glsl: Add "built-in" function to do ffloor(fp64)
Reviewed-by: Elie Tournier <tournier.elie@gmail.com>
This commit is contained in:
parent
83762afa66
commit
5c9a659f50
1 changed files with 13 additions and 0 deletions
|
|
@ -1384,6 +1384,19 @@ __ftrunc64(uint64_t __a)
|
|||
return packUint2x32(uvec2(zLo, zHi));
|
||||
}
|
||||
|
||||
uint64_t
|
||||
__ffloor64(uint64_t a)
|
||||
{
|
||||
bool is_positive = __fge64(a, 0ul);
|
||||
uint64_t tr = __ftrunc64(a);
|
||||
|
||||
if (is_positive || __feq64(tr, a)) {
|
||||
return tr;
|
||||
} else {
|
||||
return __fadd64(tr, 0xbff0000000000000ul /* -1.0 */);
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t
|
||||
__fround64(uint64_t __a)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue