Home | History | Annotate | Download | only in PowerPC
      1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64
      2 
      3 @a = global i8 1, align 1
      4 @b = global i16 2, align 2
      5 @c = global i32 4, align 4
      6 
      7 define void @t1() nounwind {
      8 ; ELF64: t1
      9   %1 = load i8, i8* @a, align 1
     10   call void @foo1(i8 zeroext %1)
     11 ; ELF64: lbz
     12 ; ELF64-NOT: rldicl
     13 ; ELF64-NOT: rlwinm
     14   ret void
     15 }
     16 
     17 define void @t2() nounwind {
     18 ; ELF64: t2
     19   %1 = load i16, i16* @b, align 2
     20   call void @foo2(i16 zeroext %1)
     21 ; ELF64: lhz
     22 ; ELF64-NOT: rldicl
     23 ; ELF64-NOT: rlwinm
     24   ret void
     25 }
     26 
     27 define void @t2a() nounwind {
     28 ; ELF64: t2a
     29   %1 = load i32, i32* @c, align 4
     30   call void @foo3(i32 zeroext %1)
     31 ; ELF64: lwz
     32 ; ELF64-NOT: rldicl
     33 ; ELF64-NOT: rlwinm
     34   ret void
     35 }
     36 
     37 declare void @foo1(i8 zeroext)
     38 declare void @foo2(i16 zeroext)
     39 declare void @foo3(i32 zeroext)
     40 
     41 define i32 @t3() nounwind {
     42 ; ELF64: t3
     43   %1 = load i8, i8* @a, align 1
     44   %2 = zext i8 %1 to i32
     45 ; ELF64: lbz
     46 ; ELF64-NOT: rlwinm
     47   ret i32 %2
     48 }
     49 
     50 define i32 @t4() nounwind {
     51 ; ELF64: t4
     52   %1 = load i16, i16* @b, align 2
     53   %2 = zext i16 %1 to i32
     54 ; ELF64: lhz
     55 ; ELF64-NOT: rlwinm
     56   ret i32 %2
     57 }
     58 
     59 define i32 @t5() nounwind {
     60 ; ELF64: t5
     61   %1 = load i16, i16* @b, align 2
     62   %2 = sext i16 %1 to i32
     63 ; ELF64: lha
     64 ; ELF64-NOT: rlwinm
     65   ret i32 %2
     66 }
     67 
     68 define i32 @t6() nounwind {
     69 ; ELF64: t6
     70   %1 = load i8, i8* @a, align 2
     71   %2 = sext i8 %1 to i32
     72 ; ELF64: lbz
     73 ; ELF64-NOT: rlwinm
     74   ret i32 %2
     75 }
     76 
     77 define i64 @t7() nounwind {
     78 ; ELF64: t7
     79   %1 = load i8, i8* @a, align 1
     80   %2 = zext i8 %1 to i64
     81 ; ELF64: lbz
     82 ; ELF64-NOT: rldicl
     83   ret i64 %2
     84 }
     85 
     86 define i64 @t8() nounwind {
     87 ; ELF64: t8
     88   %1 = load i16, i16* @b, align 2
     89   %2 = zext i16 %1 to i64
     90 ; ELF64: lhz
     91 ; ELF64-NOT: rldicl
     92   ret i64 %2
     93 }
     94 
     95 define i64 @t9() nounwind {
     96 ; ELF64: t9
     97   %1 = load i16, i16* @b, align 2
     98   %2 = sext i16 %1 to i64
     99 ; ELF64: lha
    100 ; ELF64-NOT: extsh
    101   ret i64 %2
    102 }
    103 
    104 define i64 @t10() nounwind {
    105 ; ELF64: t10
    106   %1 = load i8, i8* @a, align 2
    107   %2 = sext i8 %1 to i64
    108 ; ELF64: lbz
    109 ; ELF64: extsb
    110   ret i64 %2
    111 }
    112 
    113 define i64 @t11() nounwind {
    114 ; ELF64: t11
    115   %1 = load i32, i32* @c, align 4
    116   %2 = zext i32 %1 to i64
    117 ; ELF64: lwz
    118 ; ELF64-NOT: rldicl
    119   ret i64 %2
    120 }
    121 
    122 define i64 @t12() nounwind {
    123 ; ELF64: t12
    124   %1 = load i32, i32* @c, align 4
    125   %2 = sext i32 %1 to i64
    126 ; ELF64: lwa
    127 ; ELF64-NOT: extsw
    128   ret i64 %2
    129 }
    130