Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -O2 -mtriple=x86_64-linux-android -mattr=+mmx \
      2 ; RUN:     -enable-legalize-types-checking | FileCheck %s
      3 ; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu -mattr=+mmx \
      4 ; RUN:     -enable-legalize-types-checking | FileCheck %s
      5 
      6 ; Check all soft floating point library function calls.
      7 
      8 @vf64 = common global double 0.000000e+00, align 8
      9 @vf128 = common global fp128 0xL00000000000000000000000000000000, align 16
     10 
     11 define void @Test128Add(fp128 %d1, fp128 %d2) {
     12 entry:
     13   %add = fadd fp128 %d1, %d2
     14   store fp128 %add, fp128* @vf128, align 16
     15   ret void
     16 ; CHECK-LABEL: Test128Add:
     17 ; CHECK:       callq __addtf3
     18 ; CHECK-NEXT:  movaps %xmm0, vf128(%rip)
     19 ; CHECK:       retq
     20 }
     21 
     22 define void @Test128_1Add(fp128 %d1){
     23 entry:
     24   %0 = load fp128, fp128* @vf128, align 16
     25   %add = fadd fp128 %0, %d1
     26   store fp128 %add, fp128* @vf128, align 16
     27   ret void
     28 ; CHECK-LABEL: Test128_1Add:
     29 ; CHECK:       movaps  %xmm0, %xmm1
     30 ; CHECK-NEXT:  movaps  vf128(%rip), %xmm0
     31 ; CHECK-NEXT:  callq   __addtf3
     32 ; CHECK-NEXT:  movaps  %xmm0, vf128(%rip)
     33 ; CHECK:       retq
     34 }
     35 
     36 define void @Test128Sub(fp128 %d1, fp128 %d2){
     37 entry:
     38   %sub = fsub fp128 %d1, %d2
     39   store fp128 %sub, fp128* @vf128, align 16
     40   ret void
     41 ; CHECK-LABEL: Test128Sub:
     42 ; CHECK:       callq __subtf3
     43 ; CHECK-NEXT:  movaps %xmm0, vf128(%rip)
     44 ; CHECK:       retq
     45 }
     46 
     47 define void @Test128_1Sub(fp128 %d1){
     48 entry:
     49   %0 = load fp128, fp128* @vf128, align 16
     50   %sub = fsub fp128 %0, %d1
     51   store fp128 %sub, fp128* @vf128, align 16
     52   ret void
     53 ; CHECK-LABEL: Test128_1Sub:
     54 ; CHECK:       movaps  %xmm0, %xmm1
     55 ; CHECK-NEXT:  movaps  vf128(%rip), %xmm0
     56 ; CHECK-NEXT:  callq   __subtf3
     57 ; CHECK-NEXT:  movaps  %xmm0, vf128(%rip)
     58 ; CHECK:       retq
     59 }
     60 
     61 define void @Test128Mul(fp128 %d1, fp128 %d2){
     62 entry:
     63   %mul = fmul fp128 %d1, %d2
     64   store fp128 %mul, fp128* @vf128, align 16
     65   ret void
     66 ; CHECK-LABEL: Test128Mul:
     67 ; CHECK:       callq __multf3
     68 ; CHECK-NEXT:  movaps %xmm0, vf128(%rip)
     69 ; CHECK:       retq
     70 }
     71 
     72 define void @Test128_1Mul(fp128 %d1){
     73 entry:
     74   %0 = load fp128, fp128* @vf128, align 16
     75   %mul = fmul fp128 %0, %d1
     76   store fp128 %mul, fp128* @vf128, align 16
     77   ret void
     78 ; CHECK-LABEL: Test128_1Mul:
     79 ; CHECK:       movaps  %xmm0, %xmm1
     80 ; CHECK-NEXT:  movaps  vf128(%rip), %xmm0
     81 ; CHECK-NEXT:  callq   __multf3
     82 ; CHECK-NEXT:  movaps  %xmm0, vf128(%rip)
     83 ; CHECK:       retq
     84 }
     85 
     86 define void @Test128Div(fp128 %d1, fp128 %d2){
     87 entry:
     88   %div = fdiv fp128 %d1, %d2
     89   store fp128 %div, fp128* @vf128, align 16
     90   ret void
     91 ; CHECK-LABEL: Test128Div:
     92 ; CHECK:       callq __divtf3
     93 ; CHECK-NEXT:  movaps %xmm0, vf128(%rip)
     94 ; CHECK:       retq
     95 }
     96 
     97 define void @Test128_1Div(fp128 %d1){
     98 entry:
     99   %0 = load fp128, fp128* @vf128, align 16
    100   %div = fdiv fp128 %0, %d1
    101   store fp128 %div, fp128* @vf128, align 16
    102   ret void
    103 ; CHECK-LABEL: Test128_1Div:
    104 ; CHECK:       movaps  %xmm0, %xmm1
    105 ; CHECK-NEXT:  movaps  vf128(%rip), %xmm0
    106 ; CHECK-NEXT:  callq   __divtf3
    107 ; CHECK-NEXT:  movaps  %xmm0, vf128(%rip)
    108 ; CHECK:       retq
    109 }
    110