• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -march=hexagon -mcpu=hexagonv5  < %s | FileCheck %s
2; Generate MemOps for V4 and above.
3
4
5define void @f(i16* nocapture %p) nounwind {
6entry:
7; CHECK:  memh(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}-={{ *}}#1
8  %add.ptr = getelementptr inbounds i16* %p, i32 10
9  %0 = load i16* %add.ptr, align 2
10  %conv2 = zext i16 %0 to i32
11  %sub = add nsw i32 %conv2, 65535
12  %conv1 = trunc i32 %sub to i16
13  store i16 %conv1, i16* %add.ptr, align 2
14  ret void
15}
16
17define void @g(i16* nocapture %p, i32 %i) nounwind {
18entry:
19; CHECK:  memh(r{{[0-9]+}}{{ *}}+{{ *}}#20){{ *}}-={{ *}}#1
20  %add.ptr.sum = add i32 %i, 10
21  %add.ptr1 = getelementptr inbounds i16* %p, i32 %add.ptr.sum
22  %0 = load i16* %add.ptr1, align 2
23  %conv3 = zext i16 %0 to i32
24  %sub = add nsw i32 %conv3, 65535
25  %conv2 = trunc i32 %sub to i16
26  store i16 %conv2, i16* %add.ptr1, align 2
27  ret void
28}
29