[PATCH] D22898: AMDGPU: Fix ffloor for SI

Marek Olšák via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 13:28:21 PDT 2016


mareko added a comment.

Yeah I know about the CI bug, but it's not important for OpenGL.

0x3ff0000000000000 is 1.0.
0x3fefffffffffffff isn't 1.0. It's the largest number smaller than 1.0, which is 0.9999999999999........... it can also be written as: bitcast(1.0, i32) - 1
If you print 0x3fefffffffffffff with 6 decimal places, it will be rounded to 1.0 for the purpose of printing. I guess that's where the confusion comes from.

I don't know why 1.0 passes OpenCL conformance and bitcast(1.0, i32) - 1 doesn't. I suggest you check what the closed compiler does in this case.


https://reviews.llvm.org/D22898





More information about the llvm-commits mailing list