Lewis Crawford
25c0da8b0d
[NVPTX] Fix NaN + overflow semantics of f2ll/d2i ( #159530 )
...
Fix the NaN-handling semantics of various NVVM intrinsics converting
from fp types to integer types.
Previously in ConstantFolding, NaN inputs would be constant-folded to 0.
However, v9.0 of the PTX spec states that:
In float-to-integer conversions, depending upon conversion types, NaN
input results in following value:
* Zero if source is not `.f64` and destination is not `.s64`, .`u64`.
* Otherwise `1 << (BitWidth(dst) - 1)` corresponding to the value of
`(MAXINT >> 1) + 1` for unsigned type or `MININT` for signed type.
Also, support for constant-folding +/-Inf and values which
overflow/underflow the integer output type has been added (they clamp to
min/max int).
Because of this NaN-handling semantic difference, we also need to
disable transforming several intrinsics to FPToSI/FPToUI, as the LLVM
intstruction will return poison, but the intrinsics have defined
behaviour for these edge-cases like NaN/Inf/overflow.
2025-09-25 16:19:11 +01:00
..
2025-09-23 15:29:33 -07:00
2024-11-06 11:53:33 +00:00
2023-11-14 09:25:14 +01:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2023-11-03 10:16:15 +01:00
2023-11-03 10:16:15 +01:00
2024-07-16 11:40:04 +02:00
2024-11-06 11:53:33 +00:00
2024-01-25 13:38:23 +05:30
2025-02-04 22:53:33 +01:00
2024-12-10 15:42:05 +00:00
2024-11-06 11:53:33 +00:00
2025-07-04 22:55:07 +01:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-14 11:55:19 +01:00
2024-11-21 11:21:12 +00:00
2025-06-03 19:51:21 +08:00
2025-08-22 17:33:00 +01:00
2025-08-22 17:33:00 +01:00
2025-09-25 16:19:11 +01:00
2025-09-25 16:19:11 +01:00
2025-08-22 17:33:00 +01:00
2025-01-16 14:38:51 +00:00
2025-08-22 17:33:00 +01:00
2025-08-01 10:31:43 +01:00
2024-06-13 20:20:27 +01:00
2025-01-30 20:58:38 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-15 14:19:50 +00:00
2025-05-30 11:27:18 +01:00
2023-11-03 10:16:15 +01:00
2023-11-03 10:16:15 +01:00
2023-11-03 10:16:15 +01:00
2023-11-03 10:16:15 +01:00
2024-11-06 11:53:33 +00:00
2025-07-19 19:37:21 -07:00
2024-11-21 12:39:53 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2025-03-09 21:10:35 +08:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2025-08-10 22:55:04 +08:00
2024-11-06 11:53:33 +00:00
2025-09-25 11:11:21 +01:00
2025-09-07 18:32:40 +01:00
2024-11-21 11:21:12 +00:00
2025-06-11 13:27:14 +02:00
2024-11-06 11:53:33 +00:00
2023-11-30 17:26:23 +01:00
2024-02-14 02:16:32 +03:00
2025-05-01 14:21:59 -07:00
2025-09-24 11:35:15 +01:00
2025-04-30 15:01:00 +02:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2025-03-01 12:02:57 -05:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-07-09 14:44:48 -07:00
2025-01-29 23:14:36 +08:00
2024-11-06 11:53:33 +00:00
2024-04-17 18:22:05 +09:00
2024-11-19 20:10:40 +08:00
2025-05-02 07:49:27 +08:00
2024-04-17 18:22:05 +09:00
2024-04-29 10:16:45 +01:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-12-09 16:44:05 +01:00
2024-11-07 14:09:45 +01:00
2023-11-20 10:27:16 +00:00
2024-11-06 11:53:33 +00:00
2024-04-11 12:48:52 +08:00
2025-01-20 12:19:07 -05:00
2024-11-06 11:53:33 +00:00
2024-07-15 09:26:03 +02:00
2024-11-06 11:53:33 +00:00
2024-11-15 14:19:50 +00:00
2023-11-03 10:16:15 +01:00
2024-11-06 11:53:33 +00:00
2025-07-04 22:55:07 +01:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-10-14 14:08:12 +01:00
2024-12-17 10:58:52 +01:00
2025-02-02 19:04:23 +08:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2025-02-01 08:48:32 +01:00
2025-08-04 14:51:03 +05:30
2024-11-06 11:53:33 +00:00
2025-04-10 19:29:28 +02:00
2024-11-06 11:53:33 +00:00
2025-06-10 12:50:16 -07:00
2024-12-09 16:44:05 +01:00
2025-07-16 08:35:13 -07:00
2024-04-17 18:22:05 +09:00
2024-11-06 11:53:33 +00:00
2024-04-17 18:22:05 +09:00
2025-01-11 15:10:42 -06:00
2025-06-22 13:32:19 +08:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2025-04-03 18:03:16 +01:00
2024-11-06 11:53:33 +00:00
2025-06-16 10:07:56 -07:00
2025-04-03 16:24:56 +01:00
2025-04-03 16:24:56 +01:00
2024-11-06 11:53:33 +00:00