summary refs log tree commit diff
path: root/test/fpcnv.ssa
AgeCommit message (Collapse)Author
2024-03-01test/fpcnv: skip comparing inexactly converted intNguyễn Gia Phong
In C, if a floating point cannot be represented exactly as an integer, conversion from the former to the latter is implementation-defined. Therefore, it can be flaky to test this against QBE-defined behavior. This was discovered from (unsigned int) 4294967295.0f being an UB, because (uint64_t) 4294967295.0f is 4294967296 > UINT_MAX on amd64 when compiled by either gcc or clang.
2023-08-26Fix conversion from float/double to unsigned intMichael Forney
signed int can't represent all the values of unsigned int, so we need to do the conversion to signed long, and use the lower 32 bits as the result.
2022-01-28fix test/fpcnv (wrong spacing)Quentin Carbonneaux
2022-01-28implement float -> unsigned castsBor Grošelj Simić
amd64 lacks instruction for this so it has to be implemented with float -> signed casts. The approach is borrowed from llvm.
2022-01-28implement unsigned -> float castsBor Grošelj Simić
amd64 lacks an instruction for this so it has to be implemented with signed -> float casts: - Word casting is done by zero-extending the word to a long and then doing a regular signed cast. - Long casting is done by dividing by two with correct rounding if the highest bit is set and casting that to float, then adding 1 to mantissa with integer addition
2016-04-22refine fp conversion instructionsQuentin Carbonneaux
2016-03-28implement export controlQuentin Carbonneaux
2016-03-27extract tests out of srcQuentin Carbonneaux