[llvm] [GlobalISel] Add Saturated Truncate Instructions (PR #147526)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 9 05:44:22 PDT 2025


================
@@ -148,6 +148,33 @@ G_EXTRACT for scalar types, but acts elementwise on vectors.
 
   %1:_(s16) = G_TRUNC %0:_(s32)
 
+G_TRUNC_SSAT_S
+^^^^^^^^^^^^^^
+
+Truncate a saturated signed input to a signed result.
----------------
jayfoad wrote:

I don't think it makes sense to describe the _input_ as saturated. Rather the operation is "truncate with saturation". So I would suggest:
```suggestion
Truncate a signed input to a signed result with saturation.
```
or
```suggestion
Saturated truncation from a signed input to a signed result.
```
Same in lots of places below.

https://github.com/llvm/llvm-project/pull/147526


More information about the llvm-commits mailing list