Home | History | Annotate | Download | only in PowerPC
      1 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=g5 | FileCheck %s
      2 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr6 | FileCheck -check-prefix=CHECK-PWR6 %s
      3 ; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=a2 | FileCheck -check-prefix=CHECK-A2 %s
      4 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
      5 target triple = "powerpc64-unknown-linux-gnu"
      6 
      7 define float @foo(i32 %a) nounwind {
      8 entry:
      9   %x = sitofp i32 %a to float
     10   ret float %x
     11 
     12 ; CHECK: @foo
     13 ; CHECK: extsw [[REG:[0-9]+]], 3
     14 ; CHECK: std [[REG]],
     15 ; CHECK: lfd [[REG2:[0-9]+]],
     16 ; CHECK: fcfid [[REG3:[0-9]+]], [[REG2]]
     17 ; CHECK: frsp 1, [[REG3]]
     18 ; CHECK: blr
     19 
     20 ; CHECK-PWR6: @foo
     21 ; CHECK-PWR6: stw 3,
     22 ; CHECK-PWR6: lfiwax [[REG:[0-9]+]],
     23 ; CHECK-PWR6: fcfid [[REG2:[0-9]+]], [[REG]]
     24 ; CHECK-PWR6: frsp 1, [[REG2]]
     25 ; CHECK-PWR6: blr
     26 
     27 ; CHECK-A2: @foo
     28 ; CHECK-A2: stw 3,
     29 ; CHECK-A2: lfiwax [[REG:[0-9]+]],
     30 ; CHECK-A2: fcfids 1, [[REG]]
     31 ; CHECK-A2: blr
     32 }
     33 
     34 define double @goo(i32 %a) nounwind {
     35 entry:
     36   %x = sitofp i32 %a to double
     37   ret double %x
     38 
     39 ; CHECK: @goo
     40 ; CHECK: extsw [[REG:[0-9]+]], 3
     41 ; CHECK: std [[REG]],
     42 ; CHECK: lfd [[REG2:[0-9]+]],
     43 ; CHECK: fcfid 1, [[REG2]]
     44 ; CHECK: blr
     45 
     46 ; CHECK-PWR6: @goo
     47 ; CHECK-PWR6: stw 3,
     48 ; CHECK-PWR6: lfiwax [[REG:[0-9]+]],
     49 ; CHECK-PWR6: fcfid 1, [[REG]]
     50 ; CHECK-PWR6: blr
     51 
     52 ; CHECK-A2: @goo
     53 ; CHECK-A2: stw 3,
     54 ; CHECK-A2: lfiwax [[REG:[0-9]+]],
     55 ; CHECK-A2: fcfid 1, [[REG]]
     56 ; CHECK-A2: blr
     57 }
     58 
     59 define float @foou(i32 %a) nounwind {
     60 entry:
     61   %x = uitofp i32 %a to float
     62   ret float %x
     63 
     64 ; CHECK-A2: @foou
     65 ; CHECK-A2: stw 3,
     66 ; CHECK-A2: lfiwzx [[REG:[0-9]+]],
     67 ; CHECK-A2: fcfidus 1, [[REG]]
     68 ; CHECK-A2: blr
     69 }
     70 
     71 define double @goou(i32 %a) nounwind {
     72 entry:
     73   %x = uitofp i32 %a to double
     74   ret double %x
     75 
     76 ; CHECK-A2: @goou
     77 ; CHECK-A2: stw 3,
     78 ; CHECK-A2: lfiwzx [[REG:[0-9]+]],
     79 ; CHECK-A2: fcfidu 1, [[REG]]
     80 ; CHECK-A2: blr
     81 }
     82 
     83