[llvm] a5c9330 - [AArch64] Add some missing tests for FNMADD combine patterns. NFC.

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 15 04:40:53 PST 2022


Author: Sjoerd Meijer
Date: 2022-11-15T18:05:25+05:30
New Revision: a5c9330b540fa2be776130ced016af3ec232270b

URL: https://github.com/llvm/llvm-project/commit/a5c9330b540fa2be776130ced016af3ec232270b
DIFF: https://github.com/llvm/llvm-project/commit/a5c9330b540fa2be776130ced016af3ec232270b.diff

LOG: [AArch64] Add some missing tests for FNMADD combine patterns. NFC.

Added: 
    

Modified: 
    llvm/test/CodeGen/AArch64/arm64-fml-combines.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/AArch64/arm64-fml-combines.ll b/llvm/test/CodeGen/AArch64/arm64-fml-combines.ll
index f97498825279..2b30c05d83c9 100644
--- a/llvm/test/CodeGen/AArch64/arm64-fml-combines.ll
+++ b/llvm/test/CodeGen/AArch64/arm64-fml-combines.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -O3 -mtriple=arm64-apple-ios -enable-unsafe-fp-math | FileCheck %s
-; RUN: llc < %s -O3 -mtriple=arm64-apple-ios -fp-contract=fast | FileCheck %s
+; RUN: llc < %s -O3 -mtriple=arm64-apple-ios -enable-unsafe-fp-math -mattr=+fullfp16 | FileCheck %s
+; RUN: llc < %s -O3 -mtriple=arm64-apple-ios -fp-contract=fast -mattr=+fullfp16 | FileCheck %s
 
 define void @foo_2d(double* %src) {
 entry:
@@ -129,6 +129,16 @@ for.end:                                          ; preds = %for.body
   ret void
 }
 
+; CHECK-LABEL: test0:
+; CHECK: fnmadd h0, h0, h1, h2
+define half @test0(half %a, half %b, half %c) {
+entry:
+  %0 = fmul half %a, %b
+  %mul = fsub half -0.000000e+00, %0
+  %sub1 = fsub half %mul, %c
+  ret half %sub1
+}
+
 ; CHECK-LABEL: test1:
 ; CHECK: fnmadd s0, s0, s1, s2
 define float @test1(float %a, float %b, float %c) {
@@ -148,3 +158,30 @@ entry:
   %sub1 = fsub double %mul, %c
   ret double %sub1
 }
+
+; CHECK-LABEL: test3:
+; CHECK: fnmadd h0, h0, h1, h2
+define half @test3(half %0, half %1, half %2) {
+  %4 = fneg fast half %0
+  %5 = fmul fast half %4, %1
+  %6 = fsub fast half %5, %2
+  ret half %6
+}
+
+; CHECK-LABEL: test4:
+; CHECK: fnmadd s0, s0, s1, s2
+define float @test4(float %0, float %1, float %2) {
+  %4 = fneg fast float %0
+  %5 = fmul fast float %4, %1
+  %6 = fsub fast float %5, %2
+  ret float %6
+}
+
+; CHECK-LABEL: test5:
+; CHECK: fnmadd d0, d0, d1, d2
+define double @test5(double %0, double %1, double %2) {
+  %4 = fneg fast double %0
+  %5 = fmul fast double %4, %1
+  %6 = fsub fast double %5, %2
+  ret double %6
+}


        


More information about the llvm-commits mailing list