brintos

brintos / llvm-project-archived public Read only

0
0
Text · 772 B · 077390e Raw
21 lines · plain
1; RUN: llc -verify-machineinstrs -mcpu=g5 < %s | FileCheck %s2target datalayout = "E-m:e-i64:64-n32:64"3target triple = "powerpc64-unknown-linux-gnu"4 5define i32 @_ZNK4llvm5APInt17countLeadingZerosEv(ptr %t) nounwind {6        %tmp19 = load i64, ptr %t7        %tmp22 = tail call i64 @llvm.ctlz.i64( i64 %tmp19, i1 true )             ; <i64> [#uses=1]8        %tmp23 = trunc i64 %tmp22 to i329        %tmp89 = add i32 %tmp23, -64          ; <i32> [#uses=1]10        %tmp90 = add i32 %tmp89, 0            ; <i32> [#uses=1]11        ret i32 %tmp9012 13; CHECK-LABEL: @_ZNK4llvm5APInt17countLeadingZerosEv14; CHECK: ld [[REG1:[0-9]+]], 0(3)15; CHECK-NEXT: cntlzd [[REG2:[0-9]+]], [[REG1]]16; CHECK-NEXT: addi 3, [[REG2]], -6417; CHECK-NEXT: blr18}19 20declare i64 @llvm.ctlz.i64(i64, i1)21