[llvm] AArch64: Add FCANONICALIZE (PR #104429)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 10 01:19:18 PDT 2024
================
@@ -0,0 +1,168 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc --mtriple=aarch64 --mattr=+fullfp16 < %s | FileCheck %s --check-prefix=AARCH64
+
+declare half @llvm.fcanonicalize.f16(half)
+declare float @llvm.fcanonicalize.f32(float)
+declare double @llvm.fcanonicalize.f64(double)
+
+define half @fcanonicalize_half(half %x) {
+; AARCH64-LABEL: fcanonicalize_half:
+; AARCH64: // %bb.0:
+; AARCH64-NEXT: fminnm h0, h0, h0
+; AARCH64-NEXT: ret
+ %z = call half @llvm.canonicalize.f16(half %x)
+ ret half %z
+}
+
+define half @fcanonicalize_half_nnan(half %x) {
----------------
arsenm wrote:
```suggestion
define half @fcanonicalize_f16_nnan(half %x) {
```
https://github.com/llvm/llvm-project/pull/104429
More information about the llvm-commits
mailing list