[llvm] e85667a - [PowerPC] Add non-constant fcopysign f128 test coverage
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 3 04:04:14 PST 2021
Author: Simon Pilgrim
Date: 2021-12-03T12:04:06Z
New Revision: e85667a2fbaf916c49000144b413caf0d26b0365
URL: https://github.com/llvm/llvm-project/commit/e85667a2fbaf916c49000144b413caf0d26b0365
DIFF: https://github.com/llvm/llvm-project/commit/e85667a2fbaf916c49000144b413caf0d26b0365.diff
LOG: [PowerPC] Add non-constant fcopysign f128 test coverage
As discussed on D114589 as the constant case gets affected by SimplifyDemandedBits a lot - the non-constant case currently falls back to copysignl libcalls
Added:
Modified:
llvm/test/CodeGen/PowerPC/fp128-bitcast-after-operation.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/PowerPC/fp128-bitcast-after-operation.ll b/llvm/test/CodeGen/PowerPC/fp128-bitcast-after-operation.ll
index 3e888b616f2af..7eaf3e4cea392 100644
--- a/llvm/test/CodeGen/PowerPC/fp128-bitcast-after-operation.ll
+++ b/llvm/test/CodeGen/PowerPC/fp128-bitcast-after-operation.ll
@@ -1,8 +1,8 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s -check-prefix=PPC64-P8
-; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr7 < %s | FileCheck %s -check-prefix=PPC64
-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s -check-prefix=PPC64-P8
-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 < %s | FileCheck %s -check-prefix=PPC64
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s -check-prefixes=PPC64-P8,PPC64-P8-LE
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr7 < %s | FileCheck %s -check-prefixes=PPC64,PPC64-LE
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s -check-prefixes=PPC64-P8,PPC64-P8-BE
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 < %s | FileCheck %s -check-prefixes=PPC64,PPC64-BE
; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu < %s | FileCheck %s -check-prefix=PPC32
define i128 @test_abs(ppc_fp128 %x) nounwind {
@@ -88,8 +88,115 @@ entry:
ret i128 %1
}
-define i128 @test_copysign(ppc_fp128 %x) nounwind {
-; PPC64-P8-LABEL: test_copysign:
+define i128 @test_copysign(ppc_fp128 %x, ppc_fp128 %y) nounwind {
+; PPC64-P8-LE-LABEL: test_copysign:
+; PPC64-P8-LE: # %bb.0: # %entry
+; PPC64-P8-LE-NEXT: mflr 0
+; PPC64-P8-LE-NEXT: std 0, 16(1)
+; PPC64-P8-LE-NEXT: stdu 1, -32(1)
+; PPC64-P8-LE-NEXT: bl copysignl
+; PPC64-P8-LE-NEXT: nop
+; PPC64-P8-LE-NEXT: mffprd 3, 1
+; PPC64-P8-LE-NEXT: mffprd 4, 2
+; PPC64-P8-LE-NEXT: addi 1, 1, 32
+; PPC64-P8-LE-NEXT: ld 0, 16(1)
+; PPC64-P8-LE-NEXT: mtlr 0
+; PPC64-P8-LE-NEXT: blr
+;
+; PPC64-LE-LABEL: test_copysign:
+; PPC64-LE: # %bb.0: # %entry
+; PPC64-LE-NEXT: mflr 0
+; PPC64-LE-NEXT: std 0, 16(1)
+; PPC64-LE-NEXT: stdu 1, -48(1)
+; PPC64-LE-NEXT: bl copysignl
+; PPC64-LE-NEXT: nop
+; PPC64-LE-NEXT: stfd 1, 32(1)
+; PPC64-LE-NEXT: stfd 2, 40(1)
+; PPC64-LE-NEXT: ld 3, 32(1)
+; PPC64-LE-NEXT: ld 4, 40(1)
+; PPC64-LE-NEXT: addi 1, 1, 48
+; PPC64-LE-NEXT: ld 0, 16(1)
+; PPC64-LE-NEXT: mtlr 0
+; PPC64-LE-NEXT: blr
+;
+; PPC64-P8-BE-LABEL: test_copysign:
+; PPC64-P8-BE: # %bb.0: # %entry
+; PPC64-P8-BE-NEXT: mflr 0
+; PPC64-P8-BE-NEXT: std 0, 16(1)
+; PPC64-P8-BE-NEXT: stdu 1, -112(1)
+; PPC64-P8-BE-NEXT: bl copysignl
+; PPC64-P8-BE-NEXT: nop
+; PPC64-P8-BE-NEXT: mffprd 3, 1
+; PPC64-P8-BE-NEXT: mffprd 4, 2
+; PPC64-P8-BE-NEXT: addi 1, 1, 112
+; PPC64-P8-BE-NEXT: ld 0, 16(1)
+; PPC64-P8-BE-NEXT: mtlr 0
+; PPC64-P8-BE-NEXT: blr
+;
+; PPC64-BE-LABEL: test_copysign:
+; PPC64-BE: # %bb.0: # %entry
+; PPC64-BE-NEXT: mflr 0
+; PPC64-BE-NEXT: std 0, 16(1)
+; PPC64-BE-NEXT: stdu 1, -128(1)
+; PPC64-BE-NEXT: bl copysignl
+; PPC64-BE-NEXT: nop
+; PPC64-BE-NEXT: stfd 1, 112(1)
+; PPC64-BE-NEXT: stfd 2, 120(1)
+; PPC64-BE-NEXT: ld 3, 112(1)
+; PPC64-BE-NEXT: ld 4, 120(1)
+; PPC64-BE-NEXT: addi 1, 1, 128
+; PPC64-BE-NEXT: ld 0, 16(1)
+; PPC64-BE-NEXT: mtlr 0
+; PPC64-BE-NEXT: blr
+;
+; PPC32-LABEL: test_copysign:
+; PPC32: # %bb.0: # %entry
+; PPC32-NEXT: mflr 0
+; PPC32-NEXT: stw 0, 4(1)
+; PPC32-NEXT: stwu 1, -96(1)
+; PPC32-NEXT: stfd 1, 40(1)
+; PPC32-NEXT: lwz 3, 44(1)
+; PPC32-NEXT: stfd 2, 32(1)
+; PPC32-NEXT: stw 3, 60(1)
+; PPC32-NEXT: lwz 3, 40(1)
+; PPC32-NEXT: stfd 3, 72(1)
+; PPC32-NEXT: stw 3, 56(1)
+; PPC32-NEXT: lwz 3, 36(1)
+; PPC32-NEXT: stfd 4, 64(1)
+; PPC32-NEXT: stw 3, 52(1)
+; PPC32-NEXT: lwz 3, 32(1)
+; PPC32-NEXT: lfd 1, 56(1)
+; PPC32-NEXT: stw 3, 48(1)
+; PPC32-NEXT: lwz 3, 76(1)
+; PPC32-NEXT: lfd 2, 48(1)
+; PPC32-NEXT: stw 3, 92(1)
+; PPC32-NEXT: lwz 3, 72(1)
+; PPC32-NEXT: stw 3, 88(1)
+; PPC32-NEXT: lwz 3, 68(1)
+; PPC32-NEXT: lfd 3, 88(1)
+; PPC32-NEXT: stw 3, 84(1)
+; PPC32-NEXT: lwz 3, 64(1)
+; PPC32-NEXT: stw 3, 80(1)
+; PPC32-NEXT: lfd 4, 80(1)
+; PPC32-NEXT: bl copysignl
+; PPC32-NEXT: stfd 1, 16(1)
+; PPC32-NEXT: stfd 2, 24(1)
+; PPC32-NEXT: lwz 3, 16(1)
+; PPC32-NEXT: lwz 4, 20(1)
+; PPC32-NEXT: lwz 5, 24(1)
+; PPC32-NEXT: lwz 6, 28(1)
+; PPC32-NEXT: lwz 0, 100(1)
+; PPC32-NEXT: addi 1, 1, 96
+; PPC32-NEXT: mtlr 0
+; PPC32-NEXT: blr
+entry:
+ %0 = tail call ppc_fp128 @llvm.copysign.ppcf128(ppc_fp128 %x, ppc_fp128 %y)
+ %1 = bitcast ppc_fp128 %0 to i128
+ ret i128 %1
+}
+
+define i128 @test_copysign_const(ppc_fp128 %x) nounwind {
+; PPC64-P8-LABEL: test_copysign_const:
; PPC64-P8: # %bb.0: # %entry
; PPC64-P8-NEXT: mffprd 3, 1
; PPC64-P8-NEXT: li 4, 16399
@@ -101,7 +208,7 @@ define i128 @test_copysign(ppc_fp128 %x) nounwind {
; PPC64-P8-NEXT: xor 4, 6, 4
; PPC64-P8-NEXT: blr
;
-; PPC64-LABEL: test_copysign:
+; PPC64-LABEL: test_copysign_const:
; PPC64: # %bb.0: # %entry
; PPC64-NEXT: stfd 1, -8(1)
; PPC64-NEXT: li 4, 16399
@@ -114,7 +221,7 @@ define i128 @test_copysign(ppc_fp128 %x) nounwind {
; PPC64-NEXT: xor 4, 6, 4
; PPC64-NEXT: blr
;
-; PPC32-LABEL: test_copysign:
+; PPC32-LABEL: test_copysign_const:
; PPC32: # %bb.0: # %entry
; PPC32-NEXT: stwu 1, -32(1)
; PPC32-NEXT: stfd 1, 24(1)
More information about the llvm-commits
mailing list