• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mattr=mul,movw < %s -march=avr | FileCheck %s
2
3; Unsigned 8-bit remision
4define i8 @urem8(i8 %a, i8 %b) {
5; CHECK-LABEL: rem8:
6; CHECK: call __udivmodqi4
7; CHECK-NEXT: mov r24, r25
8; CHECK-NEXT: ret
9  %rem = urem i8 %a, %b
10  ret i8 %rem
11}
12
13; Signed 8-bit remision
14define i8 @srem8(i8 %a, i8 %b) {
15; CHECK-LABEL: srem8:
16; CHECK: call __divmodqi4
17; CHECK-NEXT: mov r24, r25
18; CHECK-NEXT: ret
19  %rem = srem i8 %a, %b
20  ret i8 %rem
21}
22
23; Unsigned 16-bit remision
24define i16 @urem16(i16 %a, i16 %b) {
25; CHECK-LABEL: urem16:
26; CHECK: call __udivmodhi4
27; CHECK-NEXT: ret
28  %rem = urem i16 %a, %b
29  ret i16 %rem
30}
31
32; Signed 16-bit remision
33define i16 @srem16(i16 %a, i16 %b) {
34; CHECK-LABEL: srem16:
35; CHECK: call __divmodhi4
36; CHECK-NEXT: ret
37  %rem = srem i16 %a, %b
38  ret i16 %rem
39}
40
41; Unsigned 32-bit remision
42define i32 @urem32(i32 %a, i32 %b) {
43; CHECK-LABEL: urem32:
44; CHECK: call __udivmodsi4
45; CHECK-NEXT: ret
46  %rem = urem i32 %a, %b
47  ret i32 %rem
48}
49
50; Signed 32-bit remision
51define i32 @srem32(i32 %a, i32 %b) {
52; CHECK-LABEL: srem32:
53; CHECK: call __divmodsi4
54; CHECK-NEXT: ret
55  %rem = srem i32 %a, %b
56  ret i32 %rem
57}
58
59