• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test that CodeGenPrepare respects endianness when splitting a store.
2;
3; RUN: llc -mtriple=s390x-linux-gnu -mcpu=z13 -force-split-store < %s  | FileCheck %s
4
5define void @fun(i16* %Src, i16* %Dst) {
6; CHECK-LABEL: # %bb.0:
7; CHECK:       lh   %r0, 0(%r2)
8; CHECK-NEXT:  stc  %r0, 1(%r3)
9; CHECK-NEXT:  srl  %r0, 8
10; CHECK-NEXT:  stc  %r0, 0(%r3)
11; CHECK-NEXT:  br   %r14
12  %1 = load i16, i16* %Src
13  %2 = trunc i16 %1 to i8
14  %3 = lshr i16 %1, 8
15  %4 = trunc i16 %3 to i8
16  %5 = zext i8 %2 to i16
17  %6 = zext i8 %4 to i16
18  %7 = shl nuw i16 %6, 8
19  %8 = or i16 %7, %5
20  store i16 %8, i16* %Dst
21  ret void
22}
23