[llvm] [AArch64][GlobalISel] Enable BF16 legalization for fadd and friends. (PR #196081)
via llvm-commits
llvm-commits at lists.llvm.org
Wed May 6 07:06:54 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-globalisel
Author: David Green (davemgreen)
<details>
<summary>Changes</summary>
This enabled bf16 promotion for the following operations in GISel, promoting them to f32 and truncating the result back:
G_FADD, G_FSUB, G_FMUL, G_FDIV, G_FMA, G_FSQRT, G_FMAXNUM, G_FMINNUM, G_FMAXIMUM, G_FMINIMUM, G_FCEIL, G_FFLOOR, G_FRINT, G_FNEARBYINT, G_INTRINSIC_TRUNC, G_INTRINSIC_ROUND, G_INTRINSIC_ROUNDEVEN
---
Patch is 168.76 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/196081.diff
7 Files Affected:
- (modified) llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp (+6-1)
- (modified) llvm/test/CodeGen/AArch64/Atomics/aarch64-atomicrmw-lsfe.ll (+195-90)
- (modified) llvm/test/CodeGen/AArch64/Atomics/aarch64-atomicrmw-v8a_fp.ll (+420-240)
- (modified) llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir (+34-34)
- (modified) llvm/test/CodeGen/AArch64/bf16-instructions.ll (+858-437)
- (modified) llvm/test/CodeGen/AArch64/bf16-v4-instructions.ll (+186-86)
- (modified) llvm/test/CodeGen/AArch64/bf16-v8-instructions.ll (+315-123)
``````````diff
diff --git a/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp b/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
index e8bc74a150b57..9771d167dbba7 100644
--- a/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
+++ b/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
@@ -450,7 +450,12 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
.legalFor(HasFP16, {f16, v4f16, v8f16})
.libcallFor({f128})
.scalarizeIf(scalarOrEltWiderThan(0, 64), 0)
- .minScalarOrElt(0, MinFPScalar)
+ .widenScalarIf(
+ [=](const LegalityQuery &Q) {
+ return (!HasFP16 && Q.Types[0].getScalarType().isFloat16()) ||
+ Q.Types[0].getScalarType().isBFloat16();
+ },
+ changeElementTo(0, f32))
.clampNumElements(0, v4s16, v8s16)
.clampNumElements(0, v2s32, v4s32)
.clampNumElements(0, v2s64, v2s64)
diff --git a/llvm/test/CodeGen/AArch64/Atomics/aarch64-atomicrmw-lsfe.ll b/llvm/test/CodeGen/AArch64/Atomics/aarch64-atomicrmw-lsfe.ll
index 290c8a60d700d..6a0b689b16888 100644
--- a/llvm/test/CodeGen/AArch64/Atomics/aarch64-atomicrmw-lsfe.ll
+++ b/llvm/test/CodeGen/AArch64/Atomics/aarch64-atomicrmw-lsfe.ll
@@ -239,8 +239,11 @@ define dso_local half @atomicrmw_fadd_half_unaligned_seq_cst(ptr %ptr, half %val
define dso_local bfloat @atomicrmw_fadd_bfloat_unaligned_monotonic(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fadd_bfloat_unaligned_monotonic:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fadd_bfloat_unaligned_monotonic:
@@ -253,8 +256,11 @@ define dso_local bfloat @atomicrmw_fadd_bfloat_unaligned_monotonic(ptr %ptr, bfl
define dso_local bfloat @atomicrmw_fadd_bfloat_unaligned_acquire(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fadd_bfloat_unaligned_acquire:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fadd_bfloat_unaligned_acquire:
@@ -267,8 +273,11 @@ define dso_local bfloat @atomicrmw_fadd_bfloat_unaligned_acquire(ptr %ptr, bfloa
define dso_local bfloat @atomicrmw_fadd_bfloat_unaligned_release(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fadd_bfloat_unaligned_release:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fadd_bfloat_unaligned_release:
@@ -281,8 +290,11 @@ define dso_local bfloat @atomicrmw_fadd_bfloat_unaligned_release(ptr %ptr, bfloa
define dso_local bfloat @atomicrmw_fadd_bfloat_unaligned_acq_rel(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fadd_bfloat_unaligned_acq_rel:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fadd_bfloat_unaligned_acq_rel:
@@ -295,8 +307,11 @@ define dso_local bfloat @atomicrmw_fadd_bfloat_unaligned_acq_rel(ptr %ptr, bfloa
define dso_local bfloat @atomicrmw_fadd_bfloat_unaligned_seq_cst(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fadd_bfloat_unaligned_seq_cst:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fadd_bfloat_unaligned_seq_cst:
@@ -449,12 +464,15 @@ define dso_local half @atomicrmw_fsub_half_aligned_seq_cst(ptr %ptr, half %value
define dso_local bfloat @atomicrmw_fsub_bfloat_aligned_monotonic(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fsub_bfloat_aligned_monotonic:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
-; -O0: ldaxrh w8, [x11]
-; -O0: cmp w8, w9, uxth
-; -O0: stlxrh w10, w12, [x11]
-; -O0: subs w9, w8, w9, uxth
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w11, w9, w11
+; -O0: add w9, w9, w11
+; -O0: csel w8, w8, w9, vs
+; -O0: ldaxrh w9, [x10]
+; -O0: cmp w9, w11, uxth
+; -O0: stlxrh w8, w12, [x10]
+; -O0: subs w8, w8, w9, uxth
;
; -O1-LABEL: atomicrmw_fsub_bfloat_aligned_monotonic:
; -O1: ldxrh w9, [x0]
@@ -467,12 +485,15 @@ define dso_local bfloat @atomicrmw_fsub_bfloat_aligned_monotonic(ptr %ptr, bfloa
define dso_local bfloat @atomicrmw_fsub_bfloat_aligned_acquire(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fsub_bfloat_aligned_acquire:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
-; -O0: ldaxrh w8, [x11]
-; -O0: cmp w8, w9, uxth
-; -O0: stlxrh w10, w12, [x11]
-; -O0: subs w9, w8, w9, uxth
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w11, w9, w11
+; -O0: add w9, w9, w11
+; -O0: csel w8, w8, w9, vs
+; -O0: ldaxrh w9, [x10]
+; -O0: cmp w9, w11, uxth
+; -O0: stlxrh w8, w12, [x10]
+; -O0: subs w8, w8, w9, uxth
;
; -O1-LABEL: atomicrmw_fsub_bfloat_aligned_acquire:
; -O1: ldaxrh w9, [x0]
@@ -485,12 +506,15 @@ define dso_local bfloat @atomicrmw_fsub_bfloat_aligned_acquire(ptr %ptr, bfloat
define dso_local bfloat @atomicrmw_fsub_bfloat_aligned_release(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fsub_bfloat_aligned_release:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
-; -O0: ldaxrh w8, [x11]
-; -O0: cmp w8, w9, uxth
-; -O0: stlxrh w10, w12, [x11]
-; -O0: subs w9, w8, w9, uxth
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w11, w9, w11
+; -O0: add w9, w9, w11
+; -O0: csel w8, w8, w9, vs
+; -O0: ldaxrh w9, [x10]
+; -O0: cmp w9, w11, uxth
+; -O0: stlxrh w8, w12, [x10]
+; -O0: subs w8, w8, w9, uxth
;
; -O1-LABEL: atomicrmw_fsub_bfloat_aligned_release:
; -O1: ldxrh w9, [x0]
@@ -503,12 +527,15 @@ define dso_local bfloat @atomicrmw_fsub_bfloat_aligned_release(ptr %ptr, bfloat
define dso_local bfloat @atomicrmw_fsub_bfloat_aligned_acq_rel(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fsub_bfloat_aligned_acq_rel:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
-; -O0: ldaxrh w8, [x11]
-; -O0: cmp w8, w9, uxth
-; -O0: stlxrh w10, w12, [x11]
-; -O0: subs w9, w8, w9, uxth
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w11, w9, w11
+; -O0: add w9, w9, w11
+; -O0: csel w8, w8, w9, vs
+; -O0: ldaxrh w9, [x10]
+; -O0: cmp w9, w11, uxth
+; -O0: stlxrh w8, w12, [x10]
+; -O0: subs w8, w8, w9, uxth
;
; -O1-LABEL: atomicrmw_fsub_bfloat_aligned_acq_rel:
; -O1: ldaxrh w9, [x0]
@@ -521,12 +548,15 @@ define dso_local bfloat @atomicrmw_fsub_bfloat_aligned_acq_rel(ptr %ptr, bfloat
define dso_local bfloat @atomicrmw_fsub_bfloat_aligned_seq_cst(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fsub_bfloat_aligned_seq_cst:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
-; -O0: ldaxrh w8, [x11]
-; -O0: cmp w8, w9, uxth
-; -O0: stlxrh w10, w12, [x11]
-; -O0: subs w9, w8, w9, uxth
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w11, w9, w11
+; -O0: add w9, w9, w11
+; -O0: csel w8, w8, w9, vs
+; -O0: ldaxrh w9, [x10]
+; -O0: cmp w9, w11, uxth
+; -O0: stlxrh w8, w12, [x10]
+; -O0: subs w8, w8, w9, uxth
;
; -O1-LABEL: atomicrmw_fsub_bfloat_aligned_seq_cst:
; -O1: ldaxrh w9, [x0]
@@ -714,8 +744,11 @@ define dso_local half @atomicrmw_fsub_half_unaligned_seq_cst(ptr %ptr, half %val
define dso_local bfloat @atomicrmw_fsub_bfloat_unaligned_monotonic(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fsub_bfloat_unaligned_monotonic:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fsub_bfloat_unaligned_monotonic:
@@ -728,8 +761,11 @@ define dso_local bfloat @atomicrmw_fsub_bfloat_unaligned_monotonic(ptr %ptr, bfl
define dso_local bfloat @atomicrmw_fsub_bfloat_unaligned_acquire(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fsub_bfloat_unaligned_acquire:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fsub_bfloat_unaligned_acquire:
@@ -742,8 +778,11 @@ define dso_local bfloat @atomicrmw_fsub_bfloat_unaligned_acquire(ptr %ptr, bfloa
define dso_local bfloat @atomicrmw_fsub_bfloat_unaligned_release(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fsub_bfloat_unaligned_release:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fsub_bfloat_unaligned_release:
@@ -756,8 +795,11 @@ define dso_local bfloat @atomicrmw_fsub_bfloat_unaligned_release(ptr %ptr, bfloa
define dso_local bfloat @atomicrmw_fsub_bfloat_unaligned_acq_rel(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fsub_bfloat_unaligned_acq_rel:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fsub_bfloat_unaligned_acq_rel:
@@ -770,8 +812,11 @@ define dso_local bfloat @atomicrmw_fsub_bfloat_unaligned_acq_rel(ptr %ptr, bfloa
define dso_local bfloat @atomicrmw_fsub_bfloat_unaligned_seq_cst(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fsub_bfloat_unaligned_seq_cst:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fsub_bfloat_unaligned_seq_cst:
@@ -1085,8 +1130,11 @@ define dso_local half @atomicrmw_fmax_half_unaligned_seq_cst(ptr %ptr, half %val
define dso_local bfloat @atomicrmw_fmax_bfloat_unaligned_monotonic(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmax_bfloat_unaligned_monotonic:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmax_bfloat_unaligned_monotonic:
@@ -1099,8 +1147,11 @@ define dso_local bfloat @atomicrmw_fmax_bfloat_unaligned_monotonic(ptr %ptr, bfl
define dso_local bfloat @atomicrmw_fmax_bfloat_unaligned_acquire(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmax_bfloat_unaligned_acquire:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmax_bfloat_unaligned_acquire:
@@ -1113,8 +1164,11 @@ define dso_local bfloat @atomicrmw_fmax_bfloat_unaligned_acquire(ptr %ptr, bfloa
define dso_local bfloat @atomicrmw_fmax_bfloat_unaligned_release(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmax_bfloat_unaligned_release:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmax_bfloat_unaligned_release:
@@ -1127,8 +1181,11 @@ define dso_local bfloat @atomicrmw_fmax_bfloat_unaligned_release(ptr %ptr, bfloa
define dso_local bfloat @atomicrmw_fmax_bfloat_unaligned_acq_rel(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmax_bfloat_unaligned_acq_rel:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmax_bfloat_unaligned_acq_rel:
@@ -1141,8 +1198,11 @@ define dso_local bfloat @atomicrmw_fmax_bfloat_unaligned_acq_rel(ptr %ptr, bfloa
define dso_local bfloat @atomicrmw_fmax_bfloat_unaligned_seq_cst(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmax_bfloat_unaligned_seq_cst:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmax_bfloat_unaligned_seq_cst:
@@ -1456,8 +1516,11 @@ define dso_local half @atomicrmw_fmin_half_unaligned_seq_cst(ptr %ptr, half %val
define dso_local bfloat @atomicrmw_fmin_bfloat_unaligned_monotonic(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmin_bfloat_unaligned_monotonic:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmin_bfloat_unaligned_monotonic:
@@ -1470,8 +1533,11 @@ define dso_local bfloat @atomicrmw_fmin_bfloat_unaligned_monotonic(ptr %ptr, bfl
define dso_local bfloat @atomicrmw_fmin_bfloat_unaligned_acquire(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmin_bfloat_unaligned_acquire:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmin_bfloat_unaligned_acquire:
@@ -1484,8 +1550,11 @@ define dso_local bfloat @atomicrmw_fmin_bfloat_unaligned_acquire(ptr %ptr, bfloa
define dso_local bfloat @atomicrmw_fmin_bfloat_unaligned_release(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmin_bfloat_unaligned_release:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmin_bfloat_unaligned_release:
@@ -1498,8 +1567,11 @@ define dso_local bfloat @atomicrmw_fmin_bfloat_unaligned_release(ptr %ptr, bfloa
define dso_local bfloat @atomicrmw_fmin_bfloat_unaligned_acq_rel(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmin_bfloat_unaligned_acq_rel:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmin_bfloat_unaligned_acq_rel:
@@ -1512,8 +1584,11 @@ define dso_local bfloat @atomicrmw_fmin_bfloat_unaligned_acq_rel(ptr %ptr, bfloa
define dso_local bfloat @atomicrmw_fmin_bfloat_unaligned_seq_cst(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmin_bfloat_unaligned_seq_cst:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmin_bfloat_unaligned_seq_cst:
@@ -1827,8 +1902,11 @@ define dso_local half @atomicrmw_fmaximum_half_unaligned_seq_cst(ptr %ptr, half
define dso_local bfloat @atomicrmw_fmaximum_bfloat_unaligned_monotonic(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmaximum_bfloat_unaligned_monotonic:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmaximum_bfloat_unaligned_monotonic:
@@ -1841,8 +1919,11 @@ define dso_local bfloat @atomicrmw_fmaximum_bfloat_unaligned_monotonic(ptr %ptr,
define dso_local bfloat @atomicrmw_fmaximum_bfloat_unaligned_acquire(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmaximum_bfloat_unaligned_acquire:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmaximum_bfloat_unaligned_acquire:
@@ -1855,8 +1936,11 @@ define dso_local bfloat @atomicrmw_fmaximum_bfloat_unaligned_acquire(ptr %ptr, b
define dso_local bfloat @atomicrmw_fmaximum_bfloat_unaligned_release(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmaximum_bfloat_unaligned_release:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmaximum_bfloat_unaligned_release:
@@ -1869,8 +1953,11 @@ define dso_local bfloat @atomicrmw_fmaximum_bfloat_unaligned_release(ptr %ptr, b
define dso_local bfloat @atomicrmw_fmaximum_bfloat_unaligned_acq_rel(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmaximum_bfloat_unaligned_acq_rel:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmaximum_bfloat_unaligned_acq_rel:
@@ -1883,8 +1970,11 @@ define dso_local bfloat @atomicrmw_fmaximum_bfloat_unaligned_acq_rel(ptr %ptr, b
define dso_local bfloat @atomicrmw_fmaximum_bfloat_unaligned_seq_cst(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fmaximum_bfloat_unaligned_seq_cst:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fmaximum_bfloat_unaligned_seq_cst:
@@ -2198,8 +2288,11 @@ define dso_local half @atomicrmw_fminimum_half_unaligned_seq_cst(ptr %ptr, half
define dso_local bfloat @atomicrmw_fminimum_bfloat_unaligned_monotonic(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fminimum_bfloat_unaligned_monotonic:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fminimum_bfloat_unaligned_monotonic:
@@ -2212,8 +2305,11 @@ define dso_local bfloat @atomicrmw_fminimum_bfloat_unaligned_monotonic(ptr %ptr,
define dso_local bfloat @atomicrmw_fminimum_bfloat_unaligned_acquire(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fminimum_bfloat_unaligned_acquire:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: add w10, w9, w10
+; -O0: add w9, w9, w10
+; -O0: csel w8, w8, w9, vs
; -O0: bl __atomic_compare_exchange
;
; -O1-LABEL: atomicrmw_fminimum_bfloat_unaligned_acquire:
@@ -2226,8 +2322,11 @@ define dso_local bfloat @atomicrmw_fminimum_bfloat_unaligned_acquire(ptr %ptr, b
define dso_local bfloat @atomicrmw_fminimum_bfloat_unaligned_release(ptr %ptr, bfloat %value) {
; -O0-LABEL: atomicrmw_fminimum_bfloat_unaligned_release:
-; -O0: add w8, w8, w9
-; -O0: add w8, w8, w9
+; -O0: orr w8, w8, #0x400000
+; -O0: and w9, w9, #0x1
+; -O0: a...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/196081
More information about the llvm-commits
mailing list