1 ; RUN: llc -verify-machineinstrs -mcpu=ppc64 < %s | FileCheck %s
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-linux-gnu -mcpu=ppc < %s | FileCheck -check-prefix=CHECK-32 %s
3 target datalayout = "E-m:e-i64:64-n32:64"
4 target triple = "powerpc64-unknown-linux-gnu"
6 ; Function Attrs: nounwind readnone
7 define signext i32 @foo4(i32 signext %a) #0 {
13 ; CHECK: srawi [[REG1:[0-9]+]], 3, 3
14 ; CHECK: addze [[REG2:[0-9]+]], [[REG1]]
15 ; CHECK: extsw 3, [[REG2]]
19 ; Function Attrs: nounwind readnone
20 define i64 @foo8(i64 %a) #0 {
26 ; CHECK: sradi [[REG1:[0-9]+]], 3, 3
27 ; CHECK: addze 3, [[REG1]]
30 ; CHECK-32-LABEL: @foo8
35 ; Function Attrs: nounwind readnone
36 define signext i32 @foo4n(i32 signext %a) #0 {
38 %div = sdiv i32 %a, -8
42 ; CHECK: srawi [[REG1:[0-9]+]], 3, 3
43 ; CHECK: addze [[REG2:[0-9]+]], [[REG1]]
44 ; CHECK: neg [[REG3:[0-9]+]], [[REG2]]
45 ; CHECK: extsw 3, [[REG3]]
49 ; Function Attrs: nounwind readnone
50 define i64 @foo8n(i64 %a) #0 {
52 %div = sdiv i64 %a, -8
56 ; CHECK: sradi [[REG1:[0-9]+]], 3, 3
57 ; CHECK: addze [[REG2:[0-9]+]], [[REG1]]
58 ; CHECK: neg 3, [[REG2]]
61 ; CHECK-32-LABEL: @foo8n
66 attributes #0 = { nounwind readnone }