[llvm] 21630ef - [X86][CodeGen] Restrict F128 lowering to GNU environment (#81664)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 13 16:40:03 PST 2024
Author: Pranav Kant
Date: 2024-02-13T16:39:59-08:00
New Revision: 21630efb5a8f411cdf39b15f21a104888145b03f
URL: https://github.com/llvm/llvm-project/commit/21630efb5a8f411cdf39b15f21a104888145b03f
DIFF: https://github.com/llvm/llvm-project/commit/21630efb5a8f411cdf39b15f21a104888145b03f.diff
LOG: [X86][CodeGen] Restrict F128 lowering to GNU environment (#81664)
Otherwise it breaks some environment like X64 Android that doesn't have
f128 functions available in its libc.
Followup to #79611.
Added:
Modified:
llvm/lib/CodeGen/TargetLoweringBase.cpp
llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
llvm/test/CodeGen/X86/fp128-libcalls.ll
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp
index dc766928e5dc94..646c0c345e54e0 100644
--- a/llvm/lib/CodeGen/TargetLoweringBase.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -123,7 +123,7 @@ void TargetLoweringBase::InitLibcalls(const Triple &TT) {
setLibcallCallingConv((RTLIB::Libcall)LC, CallingConv::C);
// Use the f128 variants of math functions on x86_64
- if (TT.getArch() == Triple::ArchType::x86_64) {
+ if (TT.getArch() == Triple::ArchType::x86_64 && TT.isGNUEnvironment()) {
setLibcallName(RTLIB::REM_F128, "fmodf128");
setLibcallName(RTLIB::FMA_F128, "fmaf128");
setLibcallName(RTLIB::SQRT_F128, "sqrtf128");
diff --git a/llvm/test/CodeGen/X86/fp128-libcalls-strict.ll b/llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
index 47234c365cad5f..f1d473f81a9fa1 100644
--- a/llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
+++ b/llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
@@ -1,10 +1,10 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -O2 -mtriple=x86_64-linux-android \
; RUN: -enable-legalize-types-checking \
-; RUN: | FileCheck %s
+; RUN: | FileCheck %s --check-prefix=ANDROID
; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu \
; RUN: -enable-legalize-types-checking \
-; RUN: | FileCheck %s
+; RUN: | FileCheck %s --check-prefix=GNU
; RUN: llc < %s -O2 -mtriple=i686-linux-gnu -mattr=+sse2 \
; RUN: -enable-legalize-types-checking \
; RUN: | FileCheck %s --check-prefix=X86
@@ -19,6 +19,20 @@ define fp128 @add(fp128 %x, fp128 %y) nounwind strictfp {
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: add:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq __addtf3 at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: add:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq __addtf3 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
+;
; X86-LABEL: add:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
@@ -56,6 +70,20 @@ define fp128 @sub(fp128 %x, fp128 %y) nounwind strictfp {
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: sub:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq __subtf3 at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: sub:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq __subtf3 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
+;
; X86-LABEL: sub:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
@@ -93,6 +121,20 @@ define fp128 @mul(fp128 %x, fp128 %y) nounwind strictfp {
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: mul:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq __multf3 at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: mul:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq __multf3 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
+;
; X86-LABEL: mul:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
@@ -130,6 +172,20 @@ define fp128 @div(fp128 %x, fp128 %y) nounwind strictfp {
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: div:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq __divtf3 at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: div:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq __divtf3 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
+;
; X86-LABEL: div:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
@@ -160,12 +216,19 @@ entry:
}
define fp128 @fma(fp128 %x, fp128 %y, fp128 %z) nounwind strictfp {
-; CHECK-LABEL: fma:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq fmaf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: fma:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq fmal at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: fma:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq fmaf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: fma:
; X86: # %bb.0: # %entry
@@ -201,12 +264,19 @@ entry:
}
define fp128 @frem(fp128 %x, fp128 %y) nounwind strictfp {
-; CHECK-LABEL: frem:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq fmodf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: frem:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq fmodl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: frem:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq fmodf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: frem:
; X86: # %bb.0: # %entry
@@ -238,12 +308,19 @@ entry:
}
define fp128 @ceil(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: ceil:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq ceilf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: ceil:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq ceill at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: ceil:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq ceilf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: ceil:
; X86: # %bb.0: # %entry
@@ -271,12 +348,19 @@ entry:
}
define fp128 @cos(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: cos:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq cosf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: cos:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq cosl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: cos:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq cosf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: cos:
; X86: # %bb.0: # %entry
@@ -304,12 +388,19 @@ entry:
}
define fp128 @exp(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: exp:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq expf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: exp:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq expl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: exp:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq expf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: exp:
; X86: # %bb.0: # %entry
@@ -337,12 +428,19 @@ entry:
}
define fp128 @exp2(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: exp2:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq exp2f128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: exp2:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq exp2l at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: exp2:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq exp2f128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: exp2:
; X86: # %bb.0: # %entry
@@ -370,12 +468,19 @@ entry:
}
define fp128 @floor(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: floor:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq floorf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: floor:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq floorl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: floor:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq floorf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: floor:
; X86: # %bb.0: # %entry
@@ -403,12 +508,19 @@ entry:
}
define fp128 @log(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: log:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq logf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: log:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq logl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: log:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq logf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: log:
; X86: # %bb.0: # %entry
@@ -436,12 +548,19 @@ entry:
}
define fp128 @log10(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: log10:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq log10f128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: log10:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq log10l at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: log10:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq log10f128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: log10:
; X86: # %bb.0: # %entry
@@ -469,12 +588,19 @@ entry:
}
define fp128 @log2(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: log2:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq log2f128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: log2:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq log2l at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: log2:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq log2f128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: log2:
; X86: # %bb.0: # %entry
@@ -502,12 +628,19 @@ entry:
}
define fp128 @maxnum(fp128 %x, fp128 %y) nounwind strictfp {
-; CHECK-LABEL: maxnum:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq fmaxf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: maxnum:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq fmaxl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: maxnum:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq fmaxf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: maxnum:
; X86: # %bb.0: # %entry
@@ -539,12 +672,19 @@ entry:
}
define fp128 @minnum(fp128 %x, fp128 %y) nounwind strictfp {
-; CHECK-LABEL: minnum:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq fminf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: minnum:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq fminl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: minnum:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq fminf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: minnum:
; X86: # %bb.0: # %entry
@@ -576,12 +716,19 @@ entry:
}
define fp128 @nearbyint(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: nearbyint:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq nearbyintf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: nearbyint:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq nearbyintl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: nearbyint:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq nearbyintf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: nearbyint:
; X86: # %bb.0: # %entry
@@ -609,12 +756,19 @@ entry:
}
define fp128 @pow(fp128 %x, fp128 %y) nounwind strictfp {
-; CHECK-LABEL: pow:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq powf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: pow:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq powl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: pow:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq powf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: pow:
; X86: # %bb.0: # %entry
@@ -653,6 +807,20 @@ define fp128 @powi(fp128 %x, i32 %y) nounwind strictfp {
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: powi:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq __powitf2 at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: powi:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq __powitf2 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
+;
; X86-LABEL: powi:
; X86: # %bb.0: # %entry
; X86-NEXT: pushl %esi
@@ -680,12 +848,19 @@ entry:
}
define fp128 @rint(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: rint:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq rintf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: rint:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq rintl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: rint:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq rintf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: rint:
; X86: # %bb.0: # %entry
@@ -713,12 +888,19 @@ entry:
}
define fp128 @round(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: round:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq roundf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: round:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq roundl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: round:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq roundf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: round:
; X86: # %bb.0: # %entry
@@ -746,12 +928,19 @@ entry:
}
define fp128 @roundeven(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: roundeven:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq roundevenf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: roundeven:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq roundevenl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: roundeven:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq roundevenf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: roundeven:
; X86: # %bb.0: # %entry
@@ -779,12 +968,19 @@ entry:
}
define fp128 @sin(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: sin:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq sinf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: sin:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq sinl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: sin:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq sinf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: sin:
; X86: # %bb.0: # %entry
@@ -812,12 +1008,19 @@ entry:
}
define fp128 @sqrt(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: sqrt:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq sqrtf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: sqrt:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq sqrtl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: sqrt:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq sqrtf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: sqrt:
; X86: # %bb.0: # %entry
@@ -845,12 +1048,19 @@ entry:
}
define fp128 @trunc(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: trunc:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq truncf128
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: trunc:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq truncl at PLT
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: trunc:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq truncf128 at PLT
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: trunc:
; X86: # %bb.0: # %entry
@@ -878,12 +1088,19 @@ entry:
}
define i32 @lrint(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: lrint:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq lrintf128
-; CHECK-NEXT: popq %rcx
-; CHECK-NEXT: retq
+; ANDROID-LABEL: lrint:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq lrintl at PLT
+; ANDROID-NEXT: popq %rcx
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: lrint:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq lrintf128 at PLT
+; GNU-NEXT: popq %rcx
+; GNU-NEXT: retq
;
; X86-LABEL: lrint:
; X86: # %bb.0: # %entry
@@ -901,12 +1118,19 @@ entry:
}
define i64 @llrint(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: llrint:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq llrintf128
-; CHECK-NEXT: popq %rcx
-; CHECK-NEXT: retq
+; ANDROID-LABEL: llrint:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq llrintl at PLT
+; ANDROID-NEXT: popq %rcx
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: llrint:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq llrintf128 at PLT
+; GNU-NEXT: popq %rcx
+; GNU-NEXT: retq
;
; X86-LABEL: llrint:
; X86: # %bb.0: # %entry
@@ -924,12 +1148,19 @@ entry:
}
define i32 @lround(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: lround:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq lroundf128
-; CHECK-NEXT: popq %rcx
-; CHECK-NEXT: retq
+; ANDROID-LABEL: lround:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq lroundl at PLT
+; ANDROID-NEXT: popq %rcx
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: lround:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq lroundf128 at PLT
+; GNU-NEXT: popq %rcx
+; GNU-NEXT: retq
;
; X86-LABEL: lround:
; X86: # %bb.0: # %entry
@@ -947,12 +1178,19 @@ entry:
}
define i64 @llround(fp128 %x) nounwind strictfp {
-; CHECK-LABEL: llround:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq llroundf128
-; CHECK-NEXT: popq %rcx
-; CHECK-NEXT: retq
+; ANDROID-LABEL: llround:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq llroundl at PLT
+; ANDROID-NEXT: popq %rcx
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: llround:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq llroundf128 at PLT
+; GNU-NEXT: popq %rcx
+; GNU-NEXT: retq
;
; X86-LABEL: llround:
; X86: # %bb.0: # %entry
@@ -986,6 +1224,38 @@ define i64 @cmp(i64 %a, i64 %b, fp128 %x, fp128 %y) #0 {
; CHECK-NEXT: popq %r14
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: cmp:
+; ANDROID: # %bb.0:
+; ANDROID-NEXT: pushq %r14
+; ANDROID-NEXT: pushq %rbx
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: movq %rsi, %rbx
+; ANDROID-NEXT: movq %rdi, %r14
+; ANDROID-NEXT: callq __eqtf2 at PLT
+; ANDROID-NEXT: testl %eax, %eax
+; ANDROID-NEXT: cmovneq %rbx, %r14
+; ANDROID-NEXT: movq %r14, %rax
+; ANDROID-NEXT: addq $8, %rsp
+; ANDROID-NEXT: popq %rbx
+; ANDROID-NEXT: popq %r14
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: cmp:
+; GNU: # %bb.0:
+; GNU-NEXT: pushq %r14
+; GNU-NEXT: pushq %rbx
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: movq %rsi, %rbx
+; GNU-NEXT: movq %rdi, %r14
+; GNU-NEXT: callq __eqtf2 at PLT
+; GNU-NEXT: testl %eax, %eax
+; GNU-NEXT: cmovneq %rbx, %r14
+; GNU-NEXT: movq %r14, %rax
+; GNU-NEXT: addq $8, %rsp
+; GNU-NEXT: popq %rbx
+; GNU-NEXT: popq %r14
+; GNU-NEXT: retq
+;
; X86-LABEL: cmp:
; X86: # %bb.0:
; X86-NEXT: subl $12, %esp
@@ -1032,6 +1302,38 @@ define i64 @cmps(i64 %a, i64 %b, fp128 %x, fp128 %y) #0 {
; CHECK-NEXT: popq %r14
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: cmps:
+; ANDROID: # %bb.0:
+; ANDROID-NEXT: pushq %r14
+; ANDROID-NEXT: pushq %rbx
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: movq %rsi, %rbx
+; ANDROID-NEXT: movq %rdi, %r14
+; ANDROID-NEXT: callq __eqtf2 at PLT
+; ANDROID-NEXT: testl %eax, %eax
+; ANDROID-NEXT: cmovneq %rbx, %r14
+; ANDROID-NEXT: movq %r14, %rax
+; ANDROID-NEXT: addq $8, %rsp
+; ANDROID-NEXT: popq %rbx
+; ANDROID-NEXT: popq %r14
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: cmps:
+; GNU: # %bb.0:
+; GNU-NEXT: pushq %r14
+; GNU-NEXT: pushq %rbx
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: movq %rsi, %rbx
+; GNU-NEXT: movq %rdi, %r14
+; GNU-NEXT: callq __eqtf2 at PLT
+; GNU-NEXT: testl %eax, %eax
+; GNU-NEXT: cmovneq %rbx, %r14
+; GNU-NEXT: movq %r14, %rax
+; GNU-NEXT: addq $8, %rsp
+; GNU-NEXT: popq %rbx
+; GNU-NEXT: popq %r14
+; GNU-NEXT: retq
+;
; X86-LABEL: cmps:
; X86: # %bb.0:
; X86-NEXT: subl $12, %esp
@@ -1089,6 +1391,60 @@ define i64 @cmp_ueq_q(i64 %a, i64 %b, fp128 %x, fp128 %y) #0 {
; CHECK-NEXT: popq %rbp
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: cmp_ueq_q:
+; ANDROID: # %bb.0:
+; ANDROID-NEXT: pushq %rbp
+; ANDROID-NEXT: pushq %r14
+; ANDROID-NEXT: pushq %rbx
+; ANDROID-NEXT: subq $32, %rsp
+; ANDROID-NEXT: movaps %xmm1, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
+; ANDROID-NEXT: movaps %xmm0, (%rsp) # 16-byte Spill
+; ANDROID-NEXT: movq %rsi, %rbx
+; ANDROID-NEXT: movq %rdi, %r14
+; ANDROID-NEXT: callq __eqtf2 at PLT
+; ANDROID-NEXT: testl %eax, %eax
+; ANDROID-NEXT: sete %bpl
+; ANDROID-NEXT: movaps (%rsp), %xmm0 # 16-byte Reload
+; ANDROID-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload
+; ANDROID-NEXT: callq __unordtf2 at PLT
+; ANDROID-NEXT: testl %eax, %eax
+; ANDROID-NEXT: setne %al
+; ANDROID-NEXT: orb %bpl, %al
+; ANDROID-NEXT: cmoveq %rbx, %r14
+; ANDROID-NEXT: movq %r14, %rax
+; ANDROID-NEXT: addq $32, %rsp
+; ANDROID-NEXT: popq %rbx
+; ANDROID-NEXT: popq %r14
+; ANDROID-NEXT: popq %rbp
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: cmp_ueq_q:
+; GNU: # %bb.0:
+; GNU-NEXT: pushq %rbp
+; GNU-NEXT: pushq %r14
+; GNU-NEXT: pushq %rbx
+; GNU-NEXT: subq $32, %rsp
+; GNU-NEXT: movaps %xmm1, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
+; GNU-NEXT: movaps %xmm0, (%rsp) # 16-byte Spill
+; GNU-NEXT: movq %rsi, %rbx
+; GNU-NEXT: movq %rdi, %r14
+; GNU-NEXT: callq __eqtf2 at PLT
+; GNU-NEXT: testl %eax, %eax
+; GNU-NEXT: sete %bpl
+; GNU-NEXT: movaps (%rsp), %xmm0 # 16-byte Reload
+; GNU-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload
+; GNU-NEXT: callq __unordtf2 at PLT
+; GNU-NEXT: testl %eax, %eax
+; GNU-NEXT: setne %al
+; GNU-NEXT: orb %bpl, %al
+; GNU-NEXT: cmoveq %rbx, %r14
+; GNU-NEXT: movq %r14, %rax
+; GNU-NEXT: addq $32, %rsp
+; GNU-NEXT: popq %rbx
+; GNU-NEXT: popq %r14
+; GNU-NEXT: popq %rbp
+; GNU-NEXT: retq
+;
; X86-LABEL: cmp_ueq_q:
; X86: # %bb.0:
; X86-NEXT: pushl %ebp
@@ -1172,6 +1528,60 @@ define i64 @cmp_one_q(i64 %a, i64 %b, fp128 %x, fp128 %y) #0 {
; CHECK-NEXT: popq %rbp
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: cmp_one_q:
+; ANDROID: # %bb.0:
+; ANDROID-NEXT: pushq %rbp
+; ANDROID-NEXT: pushq %r14
+; ANDROID-NEXT: pushq %rbx
+; ANDROID-NEXT: subq $32, %rsp
+; ANDROID-NEXT: movaps %xmm1, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
+; ANDROID-NEXT: movaps %xmm0, (%rsp) # 16-byte Spill
+; ANDROID-NEXT: movq %rsi, %rbx
+; ANDROID-NEXT: movq %rdi, %r14
+; ANDROID-NEXT: callq __eqtf2 at PLT
+; ANDROID-NEXT: testl %eax, %eax
+; ANDROID-NEXT: setne %bpl
+; ANDROID-NEXT: movaps (%rsp), %xmm0 # 16-byte Reload
+; ANDROID-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload
+; ANDROID-NEXT: callq __unordtf2 at PLT
+; ANDROID-NEXT: testl %eax, %eax
+; ANDROID-NEXT: sete %al
+; ANDROID-NEXT: testb %bpl, %al
+; ANDROID-NEXT: cmoveq %rbx, %r14
+; ANDROID-NEXT: movq %r14, %rax
+; ANDROID-NEXT: addq $32, %rsp
+; ANDROID-NEXT: popq %rbx
+; ANDROID-NEXT: popq %r14
+; ANDROID-NEXT: popq %rbp
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: cmp_one_q:
+; GNU: # %bb.0:
+; GNU-NEXT: pushq %rbp
+; GNU-NEXT: pushq %r14
+; GNU-NEXT: pushq %rbx
+; GNU-NEXT: subq $32, %rsp
+; GNU-NEXT: movaps %xmm1, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
+; GNU-NEXT: movaps %xmm0, (%rsp) # 16-byte Spill
+; GNU-NEXT: movq %rsi, %rbx
+; GNU-NEXT: movq %rdi, %r14
+; GNU-NEXT: callq __eqtf2 at PLT
+; GNU-NEXT: testl %eax, %eax
+; GNU-NEXT: setne %bpl
+; GNU-NEXT: movaps (%rsp), %xmm0 # 16-byte Reload
+; GNU-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload
+; GNU-NEXT: callq __unordtf2 at PLT
+; GNU-NEXT: testl %eax, %eax
+; GNU-NEXT: sete %al
+; GNU-NEXT: testb %bpl, %al
+; GNU-NEXT: cmoveq %rbx, %r14
+; GNU-NEXT: movq %r14, %rax
+; GNU-NEXT: addq $32, %rsp
+; GNU-NEXT: popq %rbx
+; GNU-NEXT: popq %r14
+; GNU-NEXT: popq %rbp
+; GNU-NEXT: retq
+;
; X86-LABEL: cmp_one_q:
; X86: # %bb.0:
; X86-NEXT: pushl %ebp
diff --git a/llvm/test/CodeGen/X86/fp128-libcalls.ll b/llvm/test/CodeGen/X86/fp128-libcalls.ll
index 6946ca2d575b7f..bb75ec10851197 100644
--- a/llvm/test/CodeGen/X86/fp128-libcalls.ll
+++ b/llvm/test/CodeGen/X86/fp128-libcalls.ll
@@ -1,8 +1,8 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -O2 -mtriple=x86_64-linux-android \
-; RUN: -enable-legalize-types-checking | FileCheck %s
+; RUN: -enable-legalize-types-checking | FileCheck %s --check-prefix=ANDROID
; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu \
-; RUN: -enable-legalize-types-checking | FileCheck %s
+; RUN: -enable-legalize-types-checking | FileCheck %s --check-prefix=GNU
; RUN: llc < %s -O2 -mtriple=i686-linux-gnu -mattr=sse2 \
; RUN: -enable-legalize-types-checking | FileCheck %s --check-prefix=X86
@@ -20,6 +20,22 @@ define dso_local void @Test128Add(fp128 %d1, fp128 %d2) nounwind {
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: Test128Add:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq __addtf3 at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Add:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq __addtf3 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
+;
; X86-LABEL: Test128Add:
; X86: # %bb.0: # %entry
; X86-NEXT: subl $40, %esp
@@ -56,6 +72,26 @@ define dso_local void @Test128_1Add(fp128 %d1) nounwind {
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: Test128_1Add:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: movaps %xmm0, %xmm1
+; ANDROID-NEXT: movaps vf128(%rip), %xmm0
+; ANDROID-NEXT: callq __addtf3 at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128_1Add:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: movaps %xmm0, %xmm1
+; GNU-NEXT: movaps vf128(%rip), %xmm0
+; GNU-NEXT: callq __addtf3 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
+;
; X86-LABEL: Test128_1Add:
; X86: # %bb.0: # %entry
; X86-NEXT: subl $40, %esp
@@ -91,6 +127,22 @@ define dso_local void @Test128Sub(fp128 %d1, fp128 %d2) nounwind {
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: Test128Sub:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq __subtf3 at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Sub:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq __subtf3 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
+;
; X86-LABEL: Test128Sub:
; X86: # %bb.0: # %entry
; X86-NEXT: subl $40, %esp
@@ -127,6 +179,26 @@ define dso_local void @Test128_1Sub(fp128 %d1) nounwind {
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: Test128_1Sub:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: movaps %xmm0, %xmm1
+; ANDROID-NEXT: movaps vf128(%rip), %xmm0
+; ANDROID-NEXT: callq __subtf3 at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128_1Sub:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: movaps %xmm0, %xmm1
+; GNU-NEXT: movaps vf128(%rip), %xmm0
+; GNU-NEXT: callq __subtf3 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
+;
; X86-LABEL: Test128_1Sub:
; X86: # %bb.0: # %entry
; X86-NEXT: subl $40, %esp
@@ -162,6 +234,22 @@ define dso_local void @Test128Mul(fp128 %d1, fp128 %d2) nounwind {
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: Test128Mul:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq __multf3 at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Mul:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq __multf3 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
+;
; X86-LABEL: Test128Mul:
; X86: # %bb.0: # %entry
; X86-NEXT: subl $40, %esp
@@ -198,6 +286,26 @@ define dso_local void @Test128_1Mul(fp128 %d1) nounwind {
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: Test128_1Mul:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: movaps %xmm0, %xmm1
+; ANDROID-NEXT: movaps vf128(%rip), %xmm0
+; ANDROID-NEXT: callq __multf3 at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128_1Mul:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: movaps %xmm0, %xmm1
+; GNU-NEXT: movaps vf128(%rip), %xmm0
+; GNU-NEXT: callq __multf3 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
+;
; X86-LABEL: Test128_1Mul:
; X86: # %bb.0: # %entry
; X86-NEXT: subl $40, %esp
@@ -233,6 +341,22 @@ define dso_local void @Test128Div(fp128 %d1, fp128 %d2) nounwind {
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: Test128Div:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq __divtf3 at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Div:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq __divtf3 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
+;
; X86-LABEL: Test128Div:
; X86: # %bb.0: # %entry
; X86-NEXT: subl $40, %esp
@@ -269,6 +393,26 @@ define dso_local void @Test128_1Div(fp128 %d1) nounwind {
; CHECK-NEXT: popq %rax
; CHECK-NEXT: retq
;
+; ANDROID-LABEL: Test128_1Div:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: movaps %xmm0, %xmm1
+; ANDROID-NEXT: movaps vf128(%rip), %xmm0
+; ANDROID-NEXT: callq __divtf3 at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128_1Div:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: movaps %xmm0, %xmm1
+; GNU-NEXT: movaps vf128(%rip), %xmm0
+; GNU-NEXT: callq __divtf3 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
+;
; X86-LABEL: Test128_1Div:
; X86: # %bb.0: # %entry
; X86-NEXT: subl $40, %esp
@@ -296,13 +440,21 @@ entry:
}
define dso_local void @Test128Rem(fp128 %d1, fp128 %d2) nounwind {
-; CHECK-LABEL: Test128Rem:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq fmodf128
-; CHECK-NEXT: movaps %xmm0, vf128(%rip)
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: Test128Rem:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq fmodl at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Rem:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq fmodf128 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: Test128Rem:
; X86: # %bb.0: # %entry
@@ -330,15 +482,25 @@ entry:
}
define dso_local void @Test128_1Rem(fp128 %d1) nounwind {
-; CHECK-LABEL: Test128_1Rem:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: movaps %xmm0, %xmm1
-; CHECK-NEXT: movaps vf128(%rip), %xmm0
-; CHECK-NEXT: callq fmodf128
-; CHECK-NEXT: movaps %xmm0, vf128(%rip)
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: Test128_1Rem:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: movaps %xmm0, %xmm1
+; ANDROID-NEXT: movaps vf128(%rip), %xmm0
+; ANDROID-NEXT: callq fmodl at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128_1Rem:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: movaps %xmm0, %xmm1
+; GNU-NEXT: movaps vf128(%rip), %xmm0
+; GNU-NEXT: callq fmodf128 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: Test128_1Rem:
; X86: # %bb.0: # %entry
@@ -367,13 +529,21 @@ entry:
}
define dso_local void @Test128Sqrt(fp128 %d1) nounwind {
-; CHECK-LABEL: Test128Sqrt:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq sqrtf128
-; CHECK-NEXT: movaps %xmm0, vf128(%rip)
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: Test128Sqrt:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq sqrtl at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Sqrt:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq sqrtf128 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: Test128Sqrt:
; X86: # %bb.0: # %entry
@@ -398,13 +568,21 @@ entry:
declare fp128 @llvm.sqrt.f128(fp128)
define dso_local void @Test128Sin(fp128 %d1) nounwind {
-; CHECK-LABEL: Test128Sin:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq sinf128
-; CHECK-NEXT: movaps %xmm0, vf128(%rip)
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: Test128Sin:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq sinl at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Sin:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq sinf128 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: Test128Sin:
; X86: # %bb.0: # %entry
@@ -429,13 +607,21 @@ entry:
declare fp128 @llvm.sin.f128(fp128)
define dso_local void @Test128Cos(fp128 %d1) nounwind {
-; CHECK-LABEL: Test128Cos:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq cosf128
-; CHECK-NEXT: movaps %xmm0, vf128(%rip)
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: Test128Cos:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq cosl at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Cos:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq cosf128 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: Test128Cos:
; X86: # %bb.0: # %entry
@@ -460,13 +646,21 @@ entry:
declare fp128 @llvm.cos.f128(fp128)
define dso_local void @Test128Ceil(fp128 %d1) nounwind {
-; CHECK-LABEL: Test128Ceil:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq ceilf128
-; CHECK-NEXT: movaps %xmm0, vf128(%rip)
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: Test128Ceil:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq ceill at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Ceil:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq ceilf128 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: Test128Ceil:
; X86: # %bb.0: # %entry
@@ -491,13 +685,21 @@ entry:
declare fp128 @llvm.ceil.f128(fp128)
define dso_local void @Test128Floor(fp128 %d1) nounwind {
-; CHECK-LABEL: Test128Floor:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq floorf128
-; CHECK-NEXT: movaps %xmm0, vf128(%rip)
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: Test128Floor:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq floorl at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Floor:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq floorf128 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: Test128Floor:
; X86: # %bb.0: # %entry
@@ -522,13 +724,21 @@ entry:
declare fp128 @llvm.floor.f128(fp128)
define dso_local void @Test128Trunc(fp128 %d1) nounwind {
-; CHECK-LABEL: Test128Trunc:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq truncf128
-; CHECK-NEXT: movaps %xmm0, vf128(%rip)
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: Test128Trunc:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq truncl at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Trunc:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq truncf128 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: Test128Trunc:
; X86: # %bb.0: # %entry
@@ -553,13 +763,21 @@ entry:
declare fp128 @llvm.trunc.f128(fp128)
define dso_local void @Test128Nearbyint(fp128 %d1) nounwind {
-; CHECK-LABEL: Test128Nearbyint:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq nearbyintf128
-; CHECK-NEXT: movaps %xmm0, vf128(%rip)
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: Test128Nearbyint:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq nearbyintl at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Nearbyint:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq nearbyintf128 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: Test128Nearbyint:
; X86: # %bb.0: # %entry
@@ -584,13 +802,21 @@ entry:
declare fp128 @llvm.nearbyint.f128(fp128)
define dso_local void @Test128Rint(fp128 %d1) nounwind {
-; CHECK-LABEL: Test128Rint:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq rintf128
-; CHECK-NEXT: movaps %xmm0, vf128(%rip)
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: Test128Rint:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq rintl at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Rint:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq rintf128 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: Test128Rint:
; X86: # %bb.0: # %entry
@@ -615,13 +841,21 @@ entry:
declare fp128 @llvm.rint.f128(fp128)
define dso_local void @Test128Round(fp128 %d1) nounwind {
-; CHECK-LABEL: Test128Round:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: pushq %rax
-; CHECK-NEXT: callq roundf128
-; CHECK-NEXT: movaps %xmm0, vf128(%rip)
-; CHECK-NEXT: popq %rax
-; CHECK-NEXT: retq
+; ANDROID-LABEL: Test128Round:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: pushq %rax
+; ANDROID-NEXT: callq roundl at PLT
+; ANDROID-NEXT: movaps %xmm0, vf128(%rip)
+; ANDROID-NEXT: popq %rax
+; ANDROID-NEXT: retq
+;
+; GNU-LABEL: Test128Round:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: pushq %rax
+; GNU-NEXT: callq roundf128 at PLT
+; GNU-NEXT: movaps %xmm0, vf128(%rip)
+; GNU-NEXT: popq %rax
+; GNU-NEXT: retq
;
; X86-LABEL: Test128Round:
; X86: # %bb.0: # %entry
@@ -646,9 +880,13 @@ entry:
declare fp128 @llvm.round.f128(fp128)
define fp128 @Test128FMA(fp128 %a, fp128 %b, fp128 %c) nounwind {
-; CHECK-LABEL: Test128FMA:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: jmp fmaf128 at PLT # TAILCALL
+; ANDROID-LABEL: Test128FMA:
+; ANDROID: # %bb.0: # %entry
+; ANDROID-NEXT: jmp fmal at PLT # TAILCALL
+;
+; GNU-LABEL: Test128FMA:
+; GNU: # %bb.0: # %entry
+; GNU-NEXT: jmp fmaf128 at PLT # TAILCALL
;
; X86-LABEL: Test128FMA:
; X86: # %bb.0: # %entry
More information about the llvm-commits
mailing list