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 ; zext 4 5 define i32 @zext_8_32(i8 %a) nounwind { 6 ; ELF64: zext_8_32 7 %r = zext i8 %a to i32 8 ; ELF64: clrlwi {{[0-9]+}}, {{[0-9]+}}, 24 9 ret i32 %r 10 } 11 12 define i32 @zext_16_32(i16 %a) nounwind { 13 ; ELF64: zext_16_32 14 %r = zext i16 %a to i32 15 ; ELF64: clrlwi {{[0-9]+}}, {{[0-9]+}}, 16 16 ret i32 %r 17 } 18 19 define i64 @zext_8_64(i8 %a) nounwind { 20 ; ELF64: zext_8_64 21 %r = zext i8 %a to i64 22 ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 56 23 ret i64 %r 24 } 25 26 define i64 @zext_16_64(i16 %a) nounwind { 27 ; ELF64: zext_16_64 28 %r = zext i16 %a to i64 29 ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 48 30 ret i64 %r 31 } 32 33 define i64 @zext_32_64(i32 %a) nounwind { 34 ; ELF64: zext_32_64 35 %r = zext i32 %a to i64 36 ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 32 37 ret i64 %r 38 } 39 40 ; sext 41 42 define i32 @sext_8_32(i8 %a) nounwind { 43 ; ELF64: sext_8_32 44 %r = sext i8 %a to i32 45 ; ELF64: extsb 46 ret i32 %r 47 } 48 49 define i32 @sext_16_32(i16 %a) nounwind { 50 ; ELF64: sext_16_32 51 %r = sext i16 %a to i32 52 ; ELF64: extsh 53 ret i32 %r 54 } 55 56 define i64 @sext_8_64(i8 %a) nounwind { 57 ; ELF64: sext_8_64 58 %r = sext i8 %a to i64 59 ; ELF64: extsb 60 ret i64 %r 61 } 62 63 define i64 @sext_16_64(i16 %a) nounwind { 64 ; ELF64: sext_16_64 65 %r = sext i16 %a to i64 66 ; ELF64: extsh 67 ret i64 %r 68 } 69 70 define i64 @sext_32_64(i32 %a) nounwind { 71 ; ELF64: sext_32_64 72 %r = sext i32 %a to i64 73 ; ELF64: extsw 74 ret i64 %r 75 } 76