[llvm] [AArch64][Codegen]Transform saturating smull to sqdmulh (PR #143671)

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 00:24:01 PDT 2025


https://github.com/davemgreen commented:

Can you add this test case and fix what is wrong with it? Sometimes it is best to just check for all the types that are valid.
```
define <6 x i16> @saturating_6xi16(<6 x i16> %a, <6 x i16> %b) {
  %as = sext <6 x i16> %a to <6 x i32>
  %bs = sext <6 x i16> %b to <6 x i32>
  %m = mul <6 x i32> %bs, %as
  %sh = ashr <6 x i32> %m, splat (i32 15)
  %ma = tail call <6 x i32> @llvm.smin.v6i32(<6 x i32> %sh, <6 x i32> splat (i32 32767))
  %t = trunc <6 x i32> %ma to <6 x i16>
  ret <6 x i16> %t
}
```

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


More information about the llvm-commits mailing list