llvm/llvm/test/CodeGen/PowerPC/pr35402.ll

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -O2 < %s | FileCheck %s
target triple = "powerpc64le-linux-gnu"

define void @test(ptr %p, i64 %data) {
; CHECK-LABEL: test:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    rotldi 5, 4, 16
; CHECK-NEXT:    rldicl 6, 4, 8, 56
; CHECK-NEXT:    rldimi 6, 5, 8, 48
; CHECK-NEXT:    rotldi 5, 4, 24
; CHECK-NEXT:    rldimi 6, 5, 16, 40
; CHECK-NEXT:    rotldi 5, 4, 32
; CHECK-NEXT:    rldimi 6, 5, 24, 32
; CHECK-NEXT:    rlwinm 5, 4, 8, 24, 31
; CHECK-NEXT:    rlwimi 5, 4, 24, 16, 23
; CHECK-NEXT:    stw 6, 0(3)
; CHECK-NEXT:    sth 5, 4(3)
; CHECK-NEXT:    blr
entry:
  %0 = tail call i64 @llvm.bswap.i64(i64 %data)
  %val = trunc i64 %0 to i48
  store i48 %val, ptr %p, align 1
  ret void
}

declare i64 @llvm.bswap.i64(i64)