• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse | FileCheck %s
3
4define <3 x float> @fadd(<3 x float> %v, float %d) {
5; CHECK-LABEL: fadd:
6; CHECK:       # %bb.0:
7; CHECK-NEXT:    shufps {{.*#+}} xmm1 = xmm1[0,0,0,3]
8; CHECK-NEXT:    addps %xmm1, %xmm0
9; CHECK-NEXT:    retq
10  %ins = insertelement <3 x float> undef, float %d, i32 0
11  %splat = shufflevector <3 x float> %ins, <3 x float> undef, <3 x i32> zeroinitializer
12  %add = fadd <3 x float> %splat, %v
13  ret <3 x float> %add
14}
15
16; PR29114: https://llvm.org/bugs/show_bug.cgi?id=29114
17
18define <3 x float> @fdiv(<3 x float> %v, float %d) {
19; CHECK-LABEL: fdiv:
20; CHECK:       # %bb.0:
21; CHECK-NEXT:    shufps {{.*#+}} xmm1 = xmm1[0,0,0,3]
22; CHECK-NEXT:    divps %xmm0, %xmm1
23; CHECK-NEXT:    movaps %xmm1, %xmm0
24; CHECK-NEXT:    retq
25  %ins = insertelement <3 x float> undef, float %d, i32 0
26  %splat = shufflevector <3 x float> %ins, <3 x float> undef, <3 x i32> zeroinitializer
27  %div = fdiv <3 x float> %splat, %v
28  ret <3 x float> %div
29}
30
31