summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/fp128-calling-conv.ll
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2015-12-14 22:08:36 +0000
committerChih-Hung Hsieh <chh@google.com>2015-12-14 22:08:36 +0000
commit7993e18e804dbc02f9b6a1bdaefd1193abe0e095 (patch)
tree621daf0529d81170b5486c3a6a7d326199468677 /llvm/test/CodeGen/X86/fp128-calling-conv.ll
parentf801290a91521e321887c82b23ef29fdf7389fc6 (diff)
downloadbcm5719-llvm-7993e18e804dbc02f9b6a1bdaefd1193abe0e095.tar.gz
bcm5719-llvm-7993e18e804dbc02f9b6a1bdaefd1193abe0e095.zip
[X86] Part 2 to fix x86-64 fp128 calling convention.
Part 1 was submitted in http://reviews.llvm.org/D15134. Changes in this part: * X86RegisterInfo.td, X86RecognizableInstr.cpp: Add FR128 register class. * X86CallingConv.td: Pass f128 values in XMM registers or on stack. * X86InstrCompiler.td, X86InstrInfo.td, X86InstrSSE.td: Add instruction selection patterns for f128. * X86ISelLowering.cpp: When target has MMX registers, configure MVT::f128 in FR128RegClass, with TypeSoftenFloat action, and custom actions for some opcodes. Add missed cases of MVT::f128 in places that handle f32, f64, or vector types. Add TODO comment to support f128 type in inline assembly code. * SelectionDAGBuilder.cpp: Fix infinite loop when f128 type can have VT == TLI.getTypeToTransformTo(Ctx, VT). * Add unit tests for x86-64 fp128 type. Differential Revision: http://reviews.llvm.org/D11438 llvm-svn: 255558
Diffstat (limited to 'llvm/test/CodeGen/X86/fp128-calling-conv.ll')
-rw-r--r--llvm/test/CodeGen/X86/fp128-calling-conv.ll47
1 files changed, 47 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/fp128-calling-conv.ll b/llvm/test/CodeGen/X86/fp128-calling-conv.ll
new file mode 100644
index 00000000000..e1dab30847c
--- /dev/null
+++ b/llvm/test/CodeGen/X86/fp128-calling-conv.ll
@@ -0,0 +1,47 @@
+; RUN: llc < %s -O2 -mtriple=x86_64-linux-android -mattr=+mmx | FileCheck %s
+; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu -mattr=+mmx | FileCheck %s
+
+; __float128 myFP128 = 1.0L; // x86_64-linux-android
+@myFP128 = global fp128 0xL00000000000000003FFF000000000000, align 16
+
+; The first few parameters are passed in registers and the other are on stack.
+
+define fp128 @TestParam_FP128_0(fp128 %d0, fp128 %d1, fp128 %d2, fp128 %d3, fp128 %d4, fp128 %d5, fp128 %d6, fp128 %d7, fp128 %d8, fp128 %d9, fp128 %d10, fp128 %d11, fp128 %d12, fp128 %d13, fp128 %d14, fp128 %d15, fp128 %d16, fp128 %d17, fp128 %d18, fp128 %d19) {
+entry:
+ ret fp128 %d0
+; CHECK-LABEL: TestParam_FP128_0:
+; CHECK-NOT: mov
+; CHECK: retq
+}
+
+define fp128 @TestParam_FP128_1(fp128 %d0, fp128 %d1, fp128 %d2, fp128 %d3, fp128 %d4, fp128 %d5, fp128 %d6, fp128 %d7, fp128 %d8, fp128 %d9, fp128 %d10, fp128 %d11, fp128 %d12, fp128 %d13, fp128 %d14, fp128 %d15, fp128 %d16, fp128 %d17, fp128 %d18, fp128 %d19) {
+entry:
+ ret fp128 %d1
+; CHECK-LABEL: TestParam_FP128_1:
+; CHECK: movaps %xmm1, %xmm0
+; CHECK-NEXT: retq
+}
+
+define fp128 @TestParam_FP128_7(fp128 %d0, fp128 %d1, fp128 %d2, fp128 %d3, fp128 %d4, fp128 %d5, fp128 %d6, fp128 %d7, fp128 %d8, fp128 %d9, fp128 %d10, fp128 %d11, fp128 %d12, fp128 %d13, fp128 %d14, fp128 %d15, fp128 %d16, fp128 %d17, fp128 %d18, fp128 %d19) {
+entry:
+ ret fp128 %d7
+; CHECK-LABEL: TestParam_FP128_7:
+; CHECK: movaps %xmm7, %xmm0
+; CHECK-NEXT: retq
+}
+
+define fp128 @TestParam_FP128_8(fp128 %d0, fp128 %d1, fp128 %d2, fp128 %d3, fp128 %d4, fp128 %d5, fp128 %d6, fp128 %d7, fp128 %d8, fp128 %d9, fp128 %d10, fp128 %d11, fp128 %d12, fp128 %d13, fp128 %d14, fp128 %d15, fp128 %d16, fp128 %d17, fp128 %d18, fp128 %d19) {
+entry:
+ ret fp128 %d8
+; CHECK-LABEL: TestParam_FP128_8:
+; CHECK: movaps 8(%rsp), %xmm0
+; CHECK-NEXT: retq
+}
+
+define fp128 @TestParam_FP128_9(fp128 %d0, fp128 %d1, fp128 %d2, fp128 %d3, fp128 %d4, fp128 %d5, fp128 %d6, fp128 %d7, fp128 %d8, fp128 %d9, fp128 %d10, fp128 %d11, fp128 %d12, fp128 %d13, fp128 %d14, fp128 %d15, fp128 %d16, fp128 %d17, fp128 %d18, fp128 %d19) {
+entry:
+ ret fp128 %d9
+; CHECK-LABEL: TestParam_FP128_9:
+; CHECK: movaps 24(%rsp), %xmm0
+; CHECK-NEXT: retq
+}
OpenPOWER on IntegriCloud