From 9206f9ed9cd5a0ce1bee73d80010da20c2807559 Mon Sep 17 00:00:00 2001 From: Igor Kirillov Date: Tue, 8 Aug 2023 11:30:32 +0000 Subject: [PATCH] [CodeGen] Precommit tests for D157095 (cherry picked from commit 7542477d5d6e10848ac9ba5dd5421afc7e4947d2) --- llvm/test/CodeGen/AArch64/sve-fp-combine.ll | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/llvm/test/CodeGen/AArch64/sve-fp-combine.ll b/llvm/test/CodeGen/AArch64/sve-fp-combine.ll index 87562b4..1447158 100644 --- a/llvm/test/CodeGen/AArch64/sve-fp-combine.ll +++ b/llvm/test/CodeGen/AArch64/sve-fp-combine.ll @@ -1298,6 +1298,39 @@ define @fma_sel_d_different_arg_order( %p ret %masked.mul.add } +define @fnma_sel_h_different_arg_order( %pred, %m1, %m2, %acc) { +; CHECK-LABEL: fnma_sel_h_different_arg_order: +; CHECK: // %bb.0: +; CHECK-NEXT: fmsb z0.h, p0/m, z1.h, z2.h +; CHECK-NEXT: ret + %neg_m1 = fneg contract %m1 + %mul.add = call @llvm.fma.nxv8f16( %neg_m1, %m2, %acc) + %masked.mul.add = select %pred, %mul.add, %acc + ret %masked.mul.add +} + +define @fnma_sel_s_different_arg_order( %pred, %m1, %m2, %acc) { +; CHECK-LABEL: fnma_sel_s_different_arg_order: +; CHECK: // %bb.0: +; CHECK-NEXT: fmsb z0.s, p0/m, z1.s, z2.s +; CHECK-NEXT: ret + %neg_m1 = fneg contract %m1 + %mul.add = call @llvm.fma.nxv4f32( %neg_m1, %m2, %acc) + %masked.mul.add = select %pred, %mul.add, %acc + ret %masked.mul.add +} + +define @fnma_sel_d_different_arg_order( %pred, %m1, %m2, %acc) { +; CHECK-LABEL: fnma_sel_d_different_arg_order: +; CHECK: // %bb.0: +; CHECK-NEXT: fmsb z0.d, p0/m, z1.d, z2.d +; CHECK-NEXT: ret + %neg_m1 = fneg contract %m1 + %mul.add = call @llvm.fma.nxv2f64( %neg_m1, %m2, %acc) + %masked.mul.add = select %pred, %mul.add, %acc + ret %masked.mul.add +} + declare @llvm.fma.nxv8f16(, , ) declare @llvm.fma.nxv4f32(, , ) declare @llvm.fma.nxv2f64(, , ) -- 2.7.4