diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index c9c476cbf14f71..0541bce88fa3f4 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -15914,9 +15914,9 @@ The '``llvm.sincos.*``' intrinsics returns the sine and cosine of the operand. Arguments: """""""""" -The argument is a :ref:`floating-point ` or :ref:`vector ` -of floating-point values. Returns two values matching the argument type in a -struct. +The argument is a :ref:`floating-point ` value or +:ref:`vector ` of floating-point values. Returns two values matching +the argument type in a struct. Semantics: """""""""" diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 43d49674297f6f..be718b75d1f96d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -12531,8 +12531,15 @@ SDValue SelectionDAG::UnrollVectorOp(SDNode *N, unsigned ResNE) { Scalars1.push_back(EltOp.getValue(1)); } - SDValue Vec0 = getBuildVector(VT, dl, Scalars0); - SDValue Vec1 = getBuildVector(VT1, dl, Scalars1); + for (; i < ResNE; ++i) { + Scalars0.push_back(getUNDEF(EltVT)); + Scalars1.push_back(getUNDEF(EltVT1)); + } + + EVT VecVT = EVT::getVectorVT(*getContext(), EltVT, ResNE); + EVT VecVT1 = EVT::getVectorVT(*getContext(), EltVT1, ResNE); + SDValue Vec0 = getBuildVector(VecVT, dl, Scalars0); + SDValue Vec1 = getBuildVector(VecVT1, dl, Scalars1); return getMergeValues({Vec0, Vec1}, dl); } diff --git a/llvm/test/CodeGen/AArch64/llvm.sincos.ll b/llvm/test/CodeGen/AArch64/llvm.sincos.ll index 2e3c02877dfcfa..c5efc796e7a3c4 100644 --- a/llvm/test/CodeGen/AArch64/llvm.sincos.ll +++ b/llvm/test/CodeGen/AArch64/llvm.sincos.ll @@ -237,190 +237,6 @@ define { <2 x half>, <2 x half> } @test_sincos_v2f16(<2 x half> %a) { ret { <2 x half>, <2 x half> } %result } -define <2 x half> @test_sincos_v2f16_only_use_sin(<2 x half> %a) { -; CHECK-LABEL: test_sincos_v2f16_only_use_sin: -; CHECK: // %bb.0: -; CHECK-NEXT: sub sp, sp, #64 -; CHECK-NEXT: str x30, [sp, #48] // 8-byte Folded Spill -; CHECK-NEXT: .cfi_def_cfa_offset 64 -; CHECK-NEXT: .cfi_offset w30, -16 -; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0 -; CHECK-NEXT: mov h1, v0.h[1] -; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill -; CHECK-NEXT: add x0, sp, #36 -; CHECK-NEXT: add x1, sp, #32 -; CHECK-NEXT: fcvt s0, h1 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; CHECK-NEXT: add x0, sp, #28 -; CHECK-NEXT: add x1, sp, #24 -; CHECK-NEXT: fcvt s0, h0 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; CHECK-NEXT: add x0, sp, #44 -; CHECK-NEXT: add x1, sp, #40 -; CHECK-NEXT: mov h0, v0.h[2] -; CHECK-NEXT: fcvt s0, h0 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; CHECK-NEXT: add x0, sp, #60 -; CHECK-NEXT: add x1, sp, #56 -; CHECK-NEXT: mov h0, v0.h[3] -; CHECK-NEXT: fcvt s0, h0 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr s0, [sp, #36] -; CHECK-NEXT: ldr s1, [sp, #28] -; CHECK-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload -; CHECK-NEXT: fcvt h2, s0 -; CHECK-NEXT: fcvt h0, s1 -; CHECK-NEXT: ldr s1, [sp, #44] -; CHECK-NEXT: fcvt h1, s1 -; CHECK-NEXT: mov v0.h[1], v2.h[0] -; CHECK-NEXT: ldr s2, [sp, #60] -; CHECK-NEXT: mov v0.h[2], v1.h[0] -; CHECK-NEXT: fcvt h1, s2 -; CHECK-NEXT: mov v0.h[3], v1.h[0] -; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0 -; CHECK-NEXT: add sp, sp, #64 -; CHECK-NEXT: ret -; -; NO-LIBCALL-LABEL: test_sincos_v2f16_only_use_sin: -; NO-LIBCALL: // %bb.0: -; NO-LIBCALL-NEXT: sub sp, sp, #48 -; NO-LIBCALL-NEXT: str x30, [sp, #32] // 8-byte Folded Spill -; NO-LIBCALL-NEXT: .cfi_def_cfa_offset 48 -; NO-LIBCALL-NEXT: .cfi_offset w30, -16 -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 def $q0 -; NO-LIBCALL-NEXT: mov h1, v0.h[1] -; NO-LIBCALL-NEXT: str q0, [sp, #16] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: fcvt s0, h1 -; NO-LIBCALL-NEXT: bl sinf -; NO-LIBCALL-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: fcvt h0, s0 -; NO-LIBCALL-NEXT: fcvt s1, h1 -; NO-LIBCALL-NEXT: str q0, [sp] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: fmov s0, s1 -; NO-LIBCALL-NEXT: bl sinf -; NO-LIBCALL-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: fcvt h2, s0 -; NO-LIBCALL-NEXT: mov h1, v1.h[2] -; NO-LIBCALL-NEXT: fcvt s0, h1 -; NO-LIBCALL-NEXT: ldr q1, [sp] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: mov v2.h[1], v1.h[0] -; NO-LIBCALL-NEXT: str q2, [sp] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: bl sinf -; NO-LIBCALL-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: fcvt h2, s0 -; NO-LIBCALL-NEXT: mov h1, v1.h[3] -; NO-LIBCALL-NEXT: fcvt s0, h1 -; NO-LIBCALL-NEXT: ldr q1, [sp] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: mov v1.h[2], v2.h[0] -; NO-LIBCALL-NEXT: str q1, [sp] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: bl sinf -; NO-LIBCALL-NEXT: fcvt h1, s0 -; NO-LIBCALL-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload -; NO-LIBCALL-NEXT: mov v0.h[3], v1.h[0] -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 killed $q0 -; NO-LIBCALL-NEXT: add sp, sp, #48 -; NO-LIBCALL-NEXT: ret - %result = call { <2 x half>, <2 x half> } @llvm.sincos.v2f16(<2 x half> %a) - %result.0 = extractvalue { <2 x half>, <2 x half> } %result, 0 - ret <2 x half> %result.0 -} - -define <2 x half> @test_sincos_v2f16_only_use_cos(<2 x half> %a) { -; CHECK-LABEL: test_sincos_v2f16_only_use_cos: -; CHECK: // %bb.0: -; CHECK-NEXT: sub sp, sp, #64 -; CHECK-NEXT: str x30, [sp, #48] // 8-byte Folded Spill -; CHECK-NEXT: .cfi_def_cfa_offset 64 -; CHECK-NEXT: .cfi_offset w30, -16 -; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0 -; CHECK-NEXT: mov h1, v0.h[1] -; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill -; CHECK-NEXT: add x0, sp, #36 -; CHECK-NEXT: add x1, sp, #32 -; CHECK-NEXT: fcvt s0, h1 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; CHECK-NEXT: add x0, sp, #28 -; CHECK-NEXT: add x1, sp, #24 -; CHECK-NEXT: fcvt s0, h0 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; CHECK-NEXT: add x0, sp, #44 -; CHECK-NEXT: add x1, sp, #40 -; CHECK-NEXT: mov h0, v0.h[2] -; CHECK-NEXT: fcvt s0, h0 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; CHECK-NEXT: add x0, sp, #60 -; CHECK-NEXT: add x1, sp, #56 -; CHECK-NEXT: mov h0, v0.h[3] -; CHECK-NEXT: fcvt s0, h0 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr s0, [sp, #32] -; CHECK-NEXT: ldr s1, [sp, #24] -; CHECK-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload -; CHECK-NEXT: fcvt h2, s0 -; CHECK-NEXT: fcvt h0, s1 -; CHECK-NEXT: ldr s1, [sp, #40] -; CHECK-NEXT: fcvt h1, s1 -; CHECK-NEXT: mov v0.h[1], v2.h[0] -; CHECK-NEXT: ldr s2, [sp, #56] -; CHECK-NEXT: mov v0.h[2], v1.h[0] -; CHECK-NEXT: fcvt h1, s2 -; CHECK-NEXT: mov v0.h[3], v1.h[0] -; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0 -; CHECK-NEXT: add sp, sp, #64 -; CHECK-NEXT: ret -; -; NO-LIBCALL-LABEL: test_sincos_v2f16_only_use_cos: -; NO-LIBCALL: // %bb.0: -; NO-LIBCALL-NEXT: sub sp, sp, #48 -; NO-LIBCALL-NEXT: str x30, [sp, #32] // 8-byte Folded Spill -; NO-LIBCALL-NEXT: .cfi_def_cfa_offset 48 -; NO-LIBCALL-NEXT: .cfi_offset w30, -16 -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 def $q0 -; NO-LIBCALL-NEXT: mov h1, v0.h[1] -; NO-LIBCALL-NEXT: str q0, [sp, #16] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: fcvt s0, h1 -; NO-LIBCALL-NEXT: bl cosf -; NO-LIBCALL-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: fcvt h0, s0 -; NO-LIBCALL-NEXT: fcvt s1, h1 -; NO-LIBCALL-NEXT: str q0, [sp] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: fmov s0, s1 -; NO-LIBCALL-NEXT: bl cosf -; NO-LIBCALL-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: fcvt h2, s0 -; NO-LIBCALL-NEXT: mov h1, v1.h[2] -; NO-LIBCALL-NEXT: fcvt s0, h1 -; NO-LIBCALL-NEXT: ldr q1, [sp] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: mov v2.h[1], v1.h[0] -; NO-LIBCALL-NEXT: str q2, [sp] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: bl cosf -; NO-LIBCALL-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: fcvt h2, s0 -; NO-LIBCALL-NEXT: mov h1, v1.h[3] -; NO-LIBCALL-NEXT: fcvt s0, h1 -; NO-LIBCALL-NEXT: ldr q1, [sp] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: mov v1.h[2], v2.h[0] -; NO-LIBCALL-NEXT: str q1, [sp] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: bl cosf -; NO-LIBCALL-NEXT: fcvt h1, s0 -; NO-LIBCALL-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload -; NO-LIBCALL-NEXT: mov v0.h[3], v1.h[0] -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 killed $q0 -; NO-LIBCALL-NEXT: add sp, sp, #48 -; NO-LIBCALL-NEXT: ret - %result = call { <2 x half>, <2 x half> } @llvm.sincos.v2f16(<2 x half> %a) - %result.1 = extractvalue { <2 x half>, <2 x half> } %result, 1 - ret <2 x half> %result.1 -} - define { float, float } @test_sincos_f32(float %a) { ; CHECK-LABEL: test_sincos_f32: ; CHECK: // %bb.0: @@ -456,46 +272,101 @@ define { float, float } @test_sincos_f32(float %a) { ret { float, float } %result } -define float @test_sincos_f32_only_use_sin(float %a) { -; CHECK-LABEL: test_sincos_f32_only_use_sin: +define { <3 x float>, <3 x float> } @test_sincos_v3f32(<3 x float> %a) { +; CHECK-LABEL: test_sincos_v3f32: ; CHECK: // %bb.0: -; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill -; CHECK-NEXT: .cfi_def_cfa_offset 16 -; CHECK-NEXT: .cfi_offset w30, -16 -; CHECK-NEXT: add x0, sp, #12 -; CHECK-NEXT: add x1, sp, #8 +; CHECK-NEXT: sub sp, sp, #80 +; CHECK-NEXT: str x30, [sp, #32] // 8-byte Folded Spill +; CHECK-NEXT: stp x22, x21, [sp, #48] // 16-byte Folded Spill +; CHECK-NEXT: stp x20, x19, [sp, #64] // 16-byte Folded Spill +; CHECK-NEXT: .cfi_def_cfa_offset 80 +; CHECK-NEXT: .cfi_offset w19, -8 +; CHECK-NEXT: .cfi_offset w20, -16 +; CHECK-NEXT: .cfi_offset w21, -24 +; CHECK-NEXT: .cfi_offset w22, -32 +; CHECK-NEXT: .cfi_offset w30, -48 +; CHECK-NEXT: add x0, sp, #20 +; CHECK-NEXT: add x1, sp, #16 +; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill +; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0 ; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr s0, [sp, #12] -; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload -; CHECK-NEXT: ret -; -; NO-LIBCALL-LABEL: test_sincos_f32_only_use_sin: -; NO-LIBCALL: // %bb.0: -; NO-LIBCALL-NEXT: b sinf - %result = call { float, float } @llvm.sincos.f32(float %a) - %result.0 = extractvalue { float, float } %result, 0 - ret float %result.0 -} - -define float @test_sincos_f32_only_use_cos(float %a) { -; CHECK-LABEL: test_sincos_f32_only_use_cos: -; CHECK: // %bb.0: -; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill -; CHECK-NEXT: .cfi_def_cfa_offset 16 -; CHECK-NEXT: .cfi_offset w30, -16 -; CHECK-NEXT: add x0, sp, #12 -; CHECK-NEXT: add x1, sp, #8 +; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload +; CHECK-NEXT: add x0, sp, #28 +; CHECK-NEXT: add x1, sp, #24 +; CHECK-NEXT: add x19, sp, #28 +; CHECK-NEXT: add x20, sp, #24 +; CHECK-NEXT: mov s0, v0.s[1] ; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr s0, [sp, #8] -; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload +; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload +; CHECK-NEXT: add x0, sp, #44 +; CHECK-NEXT: add x1, sp, #40 +; CHECK-NEXT: add x21, sp, #44 +; CHECK-NEXT: add x22, sp, #40 +; CHECK-NEXT: mov s0, v0.s[2] +; CHECK-NEXT: bl sincosf +; CHECK-NEXT: ldp s1, s0, [sp, #16] +; CHECK-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload +; CHECK-NEXT: ld1 { v0.s }[1], [x19] +; CHECK-NEXT: ld1 { v1.s }[1], [x20] +; CHECK-NEXT: ldp x20, x19, [sp, #64] // 16-byte Folded Reload +; CHECK-NEXT: ld1 { v0.s }[2], [x21] +; CHECK-NEXT: ld1 { v1.s }[2], [x22] +; CHECK-NEXT: ldp x22, x21, [sp, #48] // 16-byte Folded Reload +; CHECK-NEXT: add sp, sp, #80 ; CHECK-NEXT: ret ; -; NO-LIBCALL-LABEL: test_sincos_f32_only_use_cos: +; NO-LIBCALL-LABEL: test_sincos_v3f32: ; NO-LIBCALL: // %bb.0: -; NO-LIBCALL-NEXT: b cosf - %result = call { float, float } @llvm.sincos.f32(float %a) - %result.1 = extractvalue { float, float } %result, 1 - ret float %result.1 +; NO-LIBCALL-NEXT: sub sp, sp, #80 +; NO-LIBCALL-NEXT: stp d9, d8, [sp, #48] // 16-byte Folded Spill +; NO-LIBCALL-NEXT: str x30, [sp, #64] // 8-byte Folded Spill +; NO-LIBCALL-NEXT: .cfi_def_cfa_offset 80 +; NO-LIBCALL-NEXT: .cfi_offset w30, -16 +; NO-LIBCALL-NEXT: .cfi_offset b8, -24 +; NO-LIBCALL-NEXT: .cfi_offset b9, -32 +; NO-LIBCALL-NEXT: mov s8, v0.s[1] +; NO-LIBCALL-NEXT: str q0, [sp, #32] // 16-byte Folded Spill +; NO-LIBCALL-NEXT: fmov s0, s8 +; NO-LIBCALL-NEXT: bl sinf +; NO-LIBCALL-NEXT: // kill: def $s0 killed $s0 def $q0 +; NO-LIBCALL-NEXT: str q0, [sp, #16] // 16-byte Folded Spill +; NO-LIBCALL-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload +; NO-LIBCALL-NEXT: // kill: def $s0 killed $s0 killed $q0 +; NO-LIBCALL-NEXT: bl sinf +; NO-LIBCALL-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload +; NO-LIBCALL-NEXT: // kill: def $s0 killed $s0 def $q0 +; NO-LIBCALL-NEXT: mov v0.s[1], v1.s[0] +; NO-LIBCALL-NEXT: str q0, [sp, #16] // 16-byte Folded Spill +; NO-LIBCALL-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload +; NO-LIBCALL-NEXT: mov s9, v0.s[2] +; NO-LIBCALL-NEXT: fmov s0, s9 +; NO-LIBCALL-NEXT: bl sinf +; NO-LIBCALL-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload +; NO-LIBCALL-NEXT: // kill: def $s0 killed $s0 def $q0 +; NO-LIBCALL-NEXT: mov v1.s[2], v0.s[0] +; NO-LIBCALL-NEXT: fmov s0, s8 +; NO-LIBCALL-NEXT: str q1, [sp, #16] // 16-byte Folded Spill +; NO-LIBCALL-NEXT: bl cosf +; NO-LIBCALL-NEXT: // kill: def $s0 killed $s0 def $q0 +; NO-LIBCALL-NEXT: str q0, [sp] // 16-byte Folded Spill +; NO-LIBCALL-NEXT: ldr q0, [sp, #32] // 16-byte Folded Reload +; NO-LIBCALL-NEXT: // kill: def $s0 killed $s0 killed $q0 +; NO-LIBCALL-NEXT: bl cosf +; NO-LIBCALL-NEXT: ldr q1, [sp] // 16-byte Folded Reload +; NO-LIBCALL-NEXT: // kill: def $s0 killed $s0 def $q0 +; NO-LIBCALL-NEXT: mov v0.s[1], v1.s[0] +; NO-LIBCALL-NEXT: str q0, [sp, #32] // 16-byte Folded Spill +; NO-LIBCALL-NEXT: fmov s0, s9 +; NO-LIBCALL-NEXT: bl cosf +; NO-LIBCALL-NEXT: fmov s2, s0 +; NO-LIBCALL-NEXT: ldp q0, q1, [sp, #16] // 32-byte Folded Reload +; NO-LIBCALL-NEXT: ldp d9, d8, [sp, #48] // 16-byte Folded Reload +; NO-LIBCALL-NEXT: ldr x30, [sp, #64] // 8-byte Folded Reload +; NO-LIBCALL-NEXT: mov v1.s[2], v2.s[0] +; NO-LIBCALL-NEXT: add sp, sp, #80 +; NO-LIBCALL-NEXT: ret + %result = call { <3 x float>, <3 x float> } @llvm.sincos.v3f32(<3 x float> %a) + ret { <3 x float>, <3 x float> } %result } define { <2 x float>, <2 x float> } @test_sincos_v2f32(<2 x float> %a) { @@ -573,114 +444,6 @@ define { <2 x float>, <2 x float> } @test_sincos_v2f32(<2 x float> %a) { ret { <2 x float>, <2 x float> } %result } -define <2 x float> @test_sincos_v2f32_only_use_sin(<2 x float> %a) { -; CHECK-LABEL: test_sincos_v2f32_only_use_sin: -; CHECK: // %bb.0: -; CHECK-NEXT: sub sp, sp, #48 -; CHECK-NEXT: stp x30, x19, [sp, #32] // 16-byte Folded Spill -; CHECK-NEXT: .cfi_def_cfa_offset 48 -; CHECK-NEXT: .cfi_offset w19, -8 -; CHECK-NEXT: .cfi_offset w30, -16 -; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0 -; CHECK-NEXT: add x0, sp, #28 -; CHECK-NEXT: add x1, sp, #24 -; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill -; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; CHECK-NEXT: add x0, sp, #20 -; CHECK-NEXT: add x1, sp, #16 -; CHECK-NEXT: add x19, sp, #20 -; CHECK-NEXT: mov s0, v0.s[1] -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr s0, [sp, #28] -; CHECK-NEXT: ld1 { v0.s }[1], [x19] -; CHECK-NEXT: ldp x30, x19, [sp, #32] // 16-byte Folded Reload -; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0 -; CHECK-NEXT: add sp, sp, #48 -; CHECK-NEXT: ret -; -; NO-LIBCALL-LABEL: test_sincos_v2f32_only_use_sin: -; NO-LIBCALL: // %bb.0: -; NO-LIBCALL-NEXT: sub sp, sp, #48 -; NO-LIBCALL-NEXT: str x30, [sp, #32] // 8-byte Folded Spill -; NO-LIBCALL-NEXT: .cfi_def_cfa_offset 48 -; NO-LIBCALL-NEXT: .cfi_offset w30, -16 -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 def $q0 -; NO-LIBCALL-NEXT: str q0, [sp] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: mov s0, v0.s[1] -; NO-LIBCALL-NEXT: bl sinf -; NO-LIBCALL-NEXT: // kill: def $s0 killed $s0 def $q0 -; NO-LIBCALL-NEXT: str q0, [sp, #16] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: // kill: def $s0 killed $s0 killed $q0 -; NO-LIBCALL-NEXT: bl sinf -; NO-LIBCALL-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: // kill: def $s0 killed $s0 def $q0 -; NO-LIBCALL-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload -; NO-LIBCALL-NEXT: mov v0.s[1], v1.s[0] -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 killed $q0 -; NO-LIBCALL-NEXT: add sp, sp, #48 -; NO-LIBCALL-NEXT: ret - %result = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> %a) - %result.0 = extractvalue { <2 x float>, <2 x float> } %result, 0 - ret <2 x float> %result.0 -} - -define <2 x float> @test_sincos_v2f32_only_use_cos(<2 x float> %a) { -; CHECK-LABEL: test_sincos_v2f32_only_use_cos: -; CHECK: // %bb.0: -; CHECK-NEXT: sub sp, sp, #48 -; CHECK-NEXT: stp x30, x19, [sp, #32] // 16-byte Folded Spill -; CHECK-NEXT: .cfi_def_cfa_offset 48 -; CHECK-NEXT: .cfi_offset w19, -8 -; CHECK-NEXT: .cfi_offset w30, -16 -; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0 -; CHECK-NEXT: add x0, sp, #28 -; CHECK-NEXT: add x1, sp, #24 -; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill -; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; CHECK-NEXT: add x0, sp, #20 -; CHECK-NEXT: add x1, sp, #16 -; CHECK-NEXT: add x19, sp, #16 -; CHECK-NEXT: mov s0, v0.s[1] -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr s0, [sp, #24] -; CHECK-NEXT: ld1 { v0.s }[1], [x19] -; CHECK-NEXT: ldp x30, x19, [sp, #32] // 16-byte Folded Reload -; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0 -; CHECK-NEXT: add sp, sp, #48 -; CHECK-NEXT: ret -; -; NO-LIBCALL-LABEL: test_sincos_v2f32_only_use_cos: -; NO-LIBCALL: // %bb.0: -; NO-LIBCALL-NEXT: sub sp, sp, #48 -; NO-LIBCALL-NEXT: str x30, [sp, #32] // 8-byte Folded Spill -; NO-LIBCALL-NEXT: .cfi_def_cfa_offset 48 -; NO-LIBCALL-NEXT: .cfi_offset w30, -16 -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 def $q0 -; NO-LIBCALL-NEXT: str q0, [sp] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: mov s0, v0.s[1] -; NO-LIBCALL-NEXT: bl cosf -; NO-LIBCALL-NEXT: // kill: def $s0 killed $s0 def $q0 -; NO-LIBCALL-NEXT: str q0, [sp, #16] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: // kill: def $s0 killed $s0 killed $q0 -; NO-LIBCALL-NEXT: bl cosf -; NO-LIBCALL-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: // kill: def $s0 killed $s0 def $q0 -; NO-LIBCALL-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload -; NO-LIBCALL-NEXT: mov v0.s[1], v1.s[0] -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 killed $q0 -; NO-LIBCALL-NEXT: add sp, sp, #48 -; NO-LIBCALL-NEXT: ret - %result = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> %a) - %result.1 = extractvalue { <2 x float>, <2 x float> } %result, 1 - ret <2 x float> %result.1 -} - define { double, double } @test_sincos_f64(double %a) { ; CHECK-LABEL: test_sincos_f64: ; CHECK: // %bb.0: @@ -719,52 +482,6 @@ define { double, double } @test_sincos_f64(double %a) { ret { double, double } %result } -define double @test_sincos_f64_only_use_sin(double %a) { -; CHECK-LABEL: test_sincos_f64_only_use_sin: -; CHECK: // %bb.0: -; CHECK-NEXT: sub sp, sp, #32 -; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill -; CHECK-NEXT: .cfi_def_cfa_offset 32 -; CHECK-NEXT: .cfi_offset w30, -16 -; CHECK-NEXT: add x0, sp, #24 -; CHECK-NEXT: add x1, sp, #8 -; CHECK-NEXT: bl sincos -; CHECK-NEXT: ldr d0, [sp, #24] -; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload -; CHECK-NEXT: add sp, sp, #32 -; CHECK-NEXT: ret -; -; NO-LIBCALL-LABEL: test_sincos_f64_only_use_sin: -; NO-LIBCALL: // %bb.0: -; NO-LIBCALL-NEXT: b sin - %result = call { double, double } @llvm.sincos.f64(double %a) - %result.0 = extractvalue { double, double } %result, 0 - ret double %result.0 -} - -define double @test_sincos_f64_only_use_cos(double %a) { -; CHECK-LABEL: test_sincos_f64_only_use_cos: -; CHECK: // %bb.0: -; CHECK-NEXT: sub sp, sp, #32 -; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill -; CHECK-NEXT: .cfi_def_cfa_offset 32 -; CHECK-NEXT: .cfi_offset w30, -16 -; CHECK-NEXT: add x0, sp, #24 -; CHECK-NEXT: add x1, sp, #8 -; CHECK-NEXT: bl sincos -; CHECK-NEXT: ldr d0, [sp, #8] -; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload -; CHECK-NEXT: add sp, sp, #32 -; CHECK-NEXT: ret -; -; NO-LIBCALL-LABEL: test_sincos_f64_only_use_cos: -; NO-LIBCALL: // %bb.0: -; NO-LIBCALL-NEXT: b cos - %result = call { double, double } @llvm.sincos.f64(double %a) - %result.1 = extractvalue { double, double } %result, 1 - ret double %result.1 -} - define { <2 x double>, <2 x double> } @test_sincos_v2f64(<2 x double> %a) { ; CHECK-LABEL: test_sincos_v2f64: ; CHECK: // %bb.0: @@ -834,103 +551,3 @@ define { <2 x double>, <2 x double> } @test_sincos_v2f64(<2 x double> %a) { %result = call { <2 x double>, <2 x double> } @llvm.sincos.v2f64(<2 x double> %a) ret { <2 x double>, <2 x double> } %result } - -define <2 x double> @test_sincos_v2f64_only_use_sin(<2 x double> %a) { -; CHECK-LABEL: test_sincos_v2f64_only_use_sin: -; CHECK: // %bb.0: -; CHECK-NEXT: sub sp, sp, #64 -; CHECK-NEXT: stp x30, x19, [sp, #48] // 16-byte Folded Spill -; CHECK-NEXT: .cfi_def_cfa_offset 64 -; CHECK-NEXT: .cfi_offset w19, -8 -; CHECK-NEXT: .cfi_offset w30, -16 -; CHECK-NEXT: add x0, sp, #40 -; CHECK-NEXT: add x1, sp, #32 -; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill -; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0 -; CHECK-NEXT: bl sincos -; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; CHECK-NEXT: add x0, sp, #24 -; CHECK-NEXT: add x1, sp, #16 -; CHECK-NEXT: add x19, sp, #24 -; CHECK-NEXT: mov d0, v0.d[1] -; CHECK-NEXT: bl sincos -; CHECK-NEXT: ldr d0, [sp, #40] -; CHECK-NEXT: ld1 { v0.d }[1], [x19] -; CHECK-NEXT: ldp x30, x19, [sp, #48] // 16-byte Folded Reload -; CHECK-NEXT: add sp, sp, #64 -; CHECK-NEXT: ret -; -; NO-LIBCALL-LABEL: test_sincos_v2f64_only_use_sin: -; NO-LIBCALL: // %bb.0: -; NO-LIBCALL-NEXT: sub sp, sp, #48 -; NO-LIBCALL-NEXT: str x30, [sp, #32] // 8-byte Folded Spill -; NO-LIBCALL-NEXT: .cfi_def_cfa_offset 48 -; NO-LIBCALL-NEXT: .cfi_offset w30, -16 -; NO-LIBCALL-NEXT: str q0, [sp] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: mov d0, v0.d[1] -; NO-LIBCALL-NEXT: bl sin -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 def $q0 -; NO-LIBCALL-NEXT: str q0, [sp, #16] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 killed $q0 -; NO-LIBCALL-NEXT: bl sin -; NO-LIBCALL-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 def $q0 -; NO-LIBCALL-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload -; NO-LIBCALL-NEXT: mov v0.d[1], v1.d[0] -; NO-LIBCALL-NEXT: add sp, sp, #48 -; NO-LIBCALL-NEXT: ret - %result = call { <2 x double>, <2 x double> } @llvm.sincos.v2f64(<2 x double> %a) - %result.0 = extractvalue { <2 x double>, <2 x double> } %result, 0 - ret <2 x double> %result.0 -} - -define <2 x double> @test_sincos_v2f64_only_use_cos(<2 x double> %a) { -; CHECK-LABEL: test_sincos_v2f64_only_use_cos: -; CHECK: // %bb.0: -; CHECK-NEXT: sub sp, sp, #64 -; CHECK-NEXT: stp x30, x19, [sp, #48] // 16-byte Folded Spill -; CHECK-NEXT: .cfi_def_cfa_offset 64 -; CHECK-NEXT: .cfi_offset w19, -8 -; CHECK-NEXT: .cfi_offset w30, -16 -; CHECK-NEXT: add x0, sp, #40 -; CHECK-NEXT: add x1, sp, #32 -; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill -; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0 -; CHECK-NEXT: bl sincos -; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; CHECK-NEXT: add x0, sp, #24 -; CHECK-NEXT: add x1, sp, #16 -; CHECK-NEXT: add x19, sp, #16 -; CHECK-NEXT: mov d0, v0.d[1] -; CHECK-NEXT: bl sincos -; CHECK-NEXT: ldr d0, [sp, #32] -; CHECK-NEXT: ld1 { v0.d }[1], [x19] -; CHECK-NEXT: ldp x30, x19, [sp, #48] // 16-byte Folded Reload -; CHECK-NEXT: add sp, sp, #64 -; CHECK-NEXT: ret -; -; NO-LIBCALL-LABEL: test_sincos_v2f64_only_use_cos: -; NO-LIBCALL: // %bb.0: -; NO-LIBCALL-NEXT: sub sp, sp, #48 -; NO-LIBCALL-NEXT: str x30, [sp, #32] // 8-byte Folded Spill -; NO-LIBCALL-NEXT: .cfi_def_cfa_offset 48 -; NO-LIBCALL-NEXT: .cfi_offset w30, -16 -; NO-LIBCALL-NEXT: str q0, [sp] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: mov d0, v0.d[1] -; NO-LIBCALL-NEXT: bl cos -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 def $q0 -; NO-LIBCALL-NEXT: str q0, [sp, #16] // 16-byte Folded Spill -; NO-LIBCALL-NEXT: ldr q0, [sp] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 killed $q0 -; NO-LIBCALL-NEXT: bl cos -; NO-LIBCALL-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload -; NO-LIBCALL-NEXT: // kill: def $d0 killed $d0 def $q0 -; NO-LIBCALL-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload -; NO-LIBCALL-NEXT: mov v0.d[1], v1.d[0] -; NO-LIBCALL-NEXT: add sp, sp, #48 -; NO-LIBCALL-NEXT: ret - %result = call { <2 x double>, <2 x double> } @llvm.sincos.v2f64(<2 x double> %a) - %result.1 = extractvalue { <2 x double>, <2 x double> } %result, 1 - ret <2 x double> %result.1 -} diff --git a/llvm/test/CodeGen/ARM/llvm.sincos.ll b/llvm/test/CodeGen/ARM/llvm.sincos.ll index b08a642fd37178..9628405df6bcb9 100644 --- a/llvm/test/CodeGen/ARM/llvm.sincos.ll +++ b/llvm/test/CodeGen/ARM/llvm.sincos.ll @@ -107,76 +107,6 @@ define { <2 x half>, <2 x half> } @test_sincos_v2f16(<2 x half> %a) { ret { <2 x half>, <2 x half> } %result } -define <2 x half> @test_sincos_v2f16_only_use_sin(<2 x half> %a) { -; CHECK-LABEL: test_sincos_v2f16_only_use_sin: -; CHECK: @ %bb.0: -; CHECK-NEXT: push {r4, lr} -; CHECK-NEXT: sub sp, #24 -; CHECK-NEXT: mov r4, r0 -; CHECK-NEXT: mov r0, r1 -; CHECK-NEXT: bl __gnu_h2f_ieee -; CHECK-NEXT: add r1, sp, #16 -; CHECK-NEXT: add r2, sp, #12 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: mov r0, r4 -; CHECK-NEXT: bl __gnu_h2f_ieee -; CHECK-NEXT: add r1, sp, #8 -; CHECK-NEXT: add r2, sp, #4 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr r0, [sp, #16] -; CHECK-NEXT: bl __gnu_f2h_ieee -; CHECK-NEXT: ldr r1, [sp, #8] -; CHECK-NEXT: strh.w r0, [sp, #22] -; CHECK-NEXT: mov r0, r1 -; CHECK-NEXT: bl __gnu_f2h_ieee -; CHECK-NEXT: strh.w r0, [sp, #20] -; CHECK-NEXT: add r0, sp, #20 -; CHECK-NEXT: vld1.32 {d16[0]}, [r0:32] -; CHECK-NEXT: vmovl.u16 q8, d16 -; CHECK-NEXT: vmov.32 r0, d16[0] -; CHECK-NEXT: vmov.32 r1, d16[1] -; CHECK-NEXT: add sp, #24 -; CHECK-NEXT: pop {r4, pc} - %result = call { <2 x half>, <2 x half> } @llvm.sincos.v2f16(<2 x half> %a) - %result.0 = extractvalue { <2 x half>, <2 x half> } %result, 0 - ret <2 x half> %result.0 -} - -define <2 x half> @test_sincos_v2f16_only_use_cos(<2 x half> %a) { -; CHECK-LABEL: test_sincos_v2f16_only_use_cos: -; CHECK: @ %bb.0: -; CHECK-NEXT: push {r4, lr} -; CHECK-NEXT: sub sp, #24 -; CHECK-NEXT: mov r4, r0 -; CHECK-NEXT: mov r0, r1 -; CHECK-NEXT: bl __gnu_h2f_ieee -; CHECK-NEXT: add r1, sp, #16 -; CHECK-NEXT: add r2, sp, #12 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: mov r0, r4 -; CHECK-NEXT: bl __gnu_h2f_ieee -; CHECK-NEXT: add r1, sp, #8 -; CHECK-NEXT: add r2, sp, #4 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr r0, [sp, #12] -; CHECK-NEXT: bl __gnu_f2h_ieee -; CHECK-NEXT: ldr r1, [sp, #4] -; CHECK-NEXT: strh.w r0, [sp, #22] -; CHECK-NEXT: mov r0, r1 -; CHECK-NEXT: bl __gnu_f2h_ieee -; CHECK-NEXT: strh.w r0, [sp, #20] -; CHECK-NEXT: add r0, sp, #20 -; CHECK-NEXT: vld1.32 {d16[0]}, [r0:32] -; CHECK-NEXT: vmovl.u16 q8, d16 -; CHECK-NEXT: vmov.32 r0, d16[0] -; CHECK-NEXT: vmov.32 r1, d16[1] -; CHECK-NEXT: add sp, #24 -; CHECK-NEXT: pop {r4, pc} - %result = call { <2 x half>, <2 x half> } @llvm.sincos.v2f16(<2 x half> %a) - %result.1 = extractvalue { <2 x half>, <2 x half> } %result, 1 - ret <2 x half> %result.1 -} - define { float, float } @test_sincos_f32(float %a) { ; CHECK-LABEL: test_sincos_f32: ; CHECK: @ %bb.0: @@ -191,37 +121,6 @@ define { float, float } @test_sincos_f32(float %a) { ret { float, float } %result } -define float @test_sincos_f32_only_use_sin(float %a) { -; CHECK-LABEL: test_sincos_f32_only_use_sin: -; CHECK: @ %bb.0: -; CHECK-NEXT: push {r7, lr} -; CHECK-NEXT: sub sp, #8 -; CHECK-NEXT: add r1, sp, #4 -; CHECK-NEXT: mov r2, sp -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr r0, [sp, #4] -; CHECK-NEXT: add sp, #8 -; CHECK-NEXT: pop {r7, pc} - %result = call { float, float } @llvm.sincos.f32(float %a) - %result.0 = extractvalue { float, float } %result, 0 - ret float %result.0 -} - -define float @test_sincos_f32_only_use_cos(float %a) { -; CHECK-LABEL: test_sincos_f32_only_use_cos: -; CHECK: @ %bb.0: -; CHECK-NEXT: push {r7, lr} -; CHECK-NEXT: sub sp, #8 -; CHECK-NEXT: add r1, sp, #4 -; CHECK-NEXT: mov r2, sp -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: ldr r0, [sp], #8 -; CHECK-NEXT: pop {r7, pc} - %result = call { float, float } @llvm.sincos.f32(float %a) - %result.1 = extractvalue { float, float } %result, 1 - ret float %result.1 -} - define { <2 x float>, <2 x float> } @test_sincos_v2f32(<2 x float> %a) { ; CHECK-LABEL: test_sincos_v2f32: ; CHECK: @ %bb.0: @@ -250,58 +149,6 @@ define { <2 x float>, <2 x float> } @test_sincos_v2f32(<2 x float> %a) { ret { <2 x float>, <2 x float> } %result } -define <2 x float> @test_sincos_v2f32_only_use_sin(<2 x float> %a) { -; CHECK-LABEL: test_sincos_v2f32_only_use_sin: -; CHECK: @ %bb.0: -; CHECK-NEXT: push {r7, lr} -; CHECK-NEXT: vpush {d8} -; CHECK-NEXT: sub sp, #16 -; CHECK-NEXT: vmov d8, r0, r1 -; CHECK-NEXT: add r1, sp, #4 -; CHECK-NEXT: mov r2, sp -; CHECK-NEXT: vmov r0, s17 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: vmov r0, s16 -; CHECK-NEXT: add r1, sp, #12 -; CHECK-NEXT: add r2, sp, #8 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: vldr s1, [sp, #4] -; CHECK-NEXT: vldr s0, [sp, #12] -; CHECK-NEXT: vmov r0, r1, d0 -; CHECK-NEXT: add sp, #16 -; CHECK-NEXT: vpop {d8} -; CHECK-NEXT: pop {r7, pc} - %result = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> %a) - %result.0 = extractvalue { <2 x float>, <2 x float> } %result, 0 - ret <2 x float> %result.0 -} - -define <2 x float> @test_sincos_v2f32_only_use_cos(<2 x float> %a) { -; CHECK-LABEL: test_sincos_v2f32_only_use_cos: -; CHECK: @ %bb.0: -; CHECK-NEXT: push {r7, lr} -; CHECK-NEXT: vpush {d8} -; CHECK-NEXT: sub sp, #16 -; CHECK-NEXT: vmov d8, r0, r1 -; CHECK-NEXT: add r1, sp, #4 -; CHECK-NEXT: mov r2, sp -; CHECK-NEXT: vmov r0, s17 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: vmov r0, s16 -; CHECK-NEXT: add r1, sp, #12 -; CHECK-NEXT: add r2, sp, #8 -; CHECK-NEXT: bl sincosf -; CHECK-NEXT: vldr s1, [sp] -; CHECK-NEXT: vldr s0, [sp, #8] -; CHECK-NEXT: vmov r0, r1, d0 -; CHECK-NEXT: add sp, #16 -; CHECK-NEXT: vpop {d8} -; CHECK-NEXT: pop {r7, pc} - %result = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> %a) - %result.1 = extractvalue { <2 x float>, <2 x float> } %result, 1 - ret <2 x float> %result.1 -} - define { double, double } @test_sincos_f64(double %a) { ; CHECK-LABEL: test_sincos_f64: ; CHECK: @ %bb.0: @@ -317,37 +164,6 @@ define { double, double } @test_sincos_f64(double %a) { ret { double, double } %result } -define double @test_sincos_f64_only_use_sin(double %a) { -; CHECK-LABEL: test_sincos_f64_only_use_sin: -; CHECK: @ %bb.0: -; CHECK-NEXT: push {r7, lr} -; CHECK-NEXT: sub sp, #16 -; CHECK-NEXT: add r2, sp, #8 -; CHECK-NEXT: mov r3, sp -; CHECK-NEXT: bl sincos -; CHECK-NEXT: ldrd r0, r1, [sp, #8] -; CHECK-NEXT: add sp, #16 -; CHECK-NEXT: pop {r7, pc} - %result = call { double, double } @llvm.sincos.f64(double %a) - %result.0 = extractvalue { double, double } %result, 0 - ret double %result.0 -} - -define double @test_sincos_f64_only_use_cos(double %a) { -; CHECK-LABEL: test_sincos_f64_only_use_cos: -; CHECK: @ %bb.0: -; CHECK-NEXT: push {r7, lr} -; CHECK-NEXT: sub sp, #16 -; CHECK-NEXT: add r2, sp, #8 -; CHECK-NEXT: mov r3, sp -; CHECK-NEXT: bl sincos -; CHECK-NEXT: ldrd r0, r1, [sp], #16 -; CHECK-NEXT: pop {r7, pc} - %result = call { double, double } @llvm.sincos.f64(double %a) - %result.1 = extractvalue { double, double } %result, 1 - ret double %result.1 -} - define { <2 x double>, <2 x double> } @test_sincos_v2f64(<2 x double> %a) { ; CHECK-LABEL: test_sincos_v2f64: ; CHECK: @ %bb.0: @@ -376,63 +192,6 @@ define { <2 x double>, <2 x double> } @test_sincos_v2f64(<2 x double> %a) { ret { <2 x double>, <2 x double> } %result } -define <2 x double> @test_sincos_v2f64_only_use_sin(<2 x double> %a) { -; CHECK-LABEL: test_sincos_v2f64_only_use_sin: -; CHECK: @ %bb.0: -; CHECK-NEXT: push {r4, r5, r6, r7, lr} -; CHECK-NEXT: sub sp, #36 -; CHECK-NEXT: mov r6, r3 -; CHECK-NEXT: mov r4, r2 -; CHECK-NEXT: add r2, sp, #24 -; CHECK-NEXT: add r3, sp, #16 -; CHECK-NEXT: mov r7, r1 -; CHECK-NEXT: mov r5, r0 -; CHECK-NEXT: mov r0, r4 -; CHECK-NEXT: mov r1, r6 -; CHECK-NEXT: bl sincos -; CHECK-NEXT: add r2, sp, #8 -; CHECK-NEXT: mov r3, sp -; CHECK-NEXT: mov r0, r5 -; CHECK-NEXT: mov r1, r7 -; CHECK-NEXT: bl sincos -; CHECK-NEXT: vldr d16, [sp, #24] -; CHECK-NEXT: ldrd r0, r1, [sp, #8] -; CHECK-NEXT: vmov r2, r3, d16 -; CHECK-NEXT: add sp, #36 -; CHECK-NEXT: pop {r4, r5, r6, r7, pc} - %result = call { <2 x double>, <2 x double> } @llvm.sincos.v2f64(<2 x double> %a) - %result.0 = extractvalue { <2 x double>, <2 x double> } %result, 0 - ret <2 x double> %result.0 -} - -define <2 x double> @test_sincos_v2f64_only_use_cos(<2 x double> %a) { -; CHECK-LABEL: test_sincos_v2f64_only_use_cos: -; CHECK: @ %bb.0: -; CHECK-NEXT: push {r4, r5, r6, r7, lr} -; CHECK-NEXT: sub sp, #36 -; CHECK-NEXT: mov r6, r3 -; CHECK-NEXT: mov r4, r2 -; CHECK-NEXT: add r2, sp, #24 -; CHECK-NEXT: add r3, sp, #16 -; CHECK-NEXT: mov r7, r1 -; CHECK-NEXT: mov r5, r0 -; CHECK-NEXT: mov r0, r4 -; CHECK-NEXT: mov r1, r6 -; CHECK-NEXT: bl sincos -; CHECK-NEXT: add r2, sp, #8 -; CHECK-NEXT: mov r3, sp -; CHECK-NEXT: mov r0, r5 -; CHECK-NEXT: mov r1, r7 -; CHECK-NEXT: bl sincos -; CHECK-NEXT: vldr d16, [sp, #16] -; CHECK-NEXT: vmov r2, r3, d16 -; CHECK-NEXT: ldrd r0, r1, [sp], #36 -; CHECK-NEXT: pop {r4, r5, r6, r7, pc} - %result = call { <2 x double>, <2 x double> } @llvm.sincos.v2f64(<2 x double> %a) - %result.1 = extractvalue { <2 x double>, <2 x double> } %result, 1 - ret <2 x double> %result.1 -} - define { fp128, fp128 } @test_sincos_f128(fp128 %a) { ; CHECK-LABEL: test_sincos_f128: ; CHECK: @ %bb.0: