llvm-6502/test/CodeGen/PowerPC/constants-i64.ll
Hal Finkel d138a7bb3f [PowerPC] Materialize i64 constants using bit inversion
Materializing full 64-bit constants on PPC64 can be expensive, requiring up to
5 instructions depending on the locations of the non-zero bits. Sometimes
materializing the bit-reversed constant, and then flipping the bits, requires
fewer instructions than the direct method. If so, do that instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225132 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-04 12:35:03 +00:00

21 lines
457 B
LLVM

; RUN: llc -mcpu=ppc64 < %s | FileCheck %s
target datalayout = "E-m:e-i64:64-n32:64"
target triple = "powerpc64-unknown-linux-gnu"
; Function Attrs: nounwind readnone
define i64 @cn1() #0 {
entry:
ret i64 281474976710655
; CHECK-LABEL: @cn1
; CHECK: li [[REG1:[0-9]+]], 0
; CHECK: ori [[REG2:[0-9]+]], [[REG1]], 65535
; CHECK: sldi [[REG3:[0-9]+]], [[REG2]], 48
; CHECK: nor 3, [[REG3]], [[REG3]]
; CHECK: blr
}
attributes #0 = { nounwind readnone }