• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=avr | FileCheck %s
2
3define i8 @trunc8_loreg(i16 %x, i16 %y) {
4; CHECK-LABEL: trunc8_loreg:
5; CHECK: mov r24, r22
6; CHECK-NEXT: ret
7  %conv = trunc i16 %y to i8
8  ret i8 %conv
9}
10
11define i8 @trunc8_hireg(i16 %x, i16 %y) {
12; CHECK-LABEL: trunc8_hireg:
13; CHECK: mov r24, r23
14; CHECK-NEXT: ret
15  %shr1 = lshr i16 %y, 8
16  %conv = trunc i16 %shr1 to i8
17  ret i8 %conv
18}
19