1 ; RUN: llc < %s -march=avr | FileCheck %s
3 define i8 @sub8_reg_reg(i8 %a, i8 %b) {
4 ; CHECK-LABEL: sub8_reg_reg:
6 %result = sub i8 %a, %b
10 define i8 @sub8_reg_imm(i8 %a) {
11 ; CHECK-LABEL: sub8_reg_imm:
13 %result = sub i8 %a, 5
17 define i8 @sub8_reg_decrement(i8 %a) {
18 ; CHECK-LABEL: sub8_reg_decrement:
20 %result = sub i8 %a, 1
24 define i16 @sub16_reg_reg(i16 %a, i16 %b) {
25 ; CHECK-LABEL: sub16_reg_reg:
28 %result = sub i16 %a, %b
32 define i16 @sub16_reg_imm(i16 %a) {
33 ; CHECK-LABEL: sub16_reg_imm:
35 %result = sub i16 %a, 63
39 define i16 @sub16_reg_imm_subi(i16 %a) {
40 ; CHECK-LABEL: sub16_reg_imm_subi:
41 ; CHECK: subi r24, 210
43 %result = sub i16 %a, 1234
47 define i32 @sub32_reg_reg(i32 %a, i32 %b) {
48 ; CHECK-LABEL: sub32_reg_reg:
53 %result = sub i32 %a, %b
57 define i32 @sub32_reg_imm(i32 %a) {
58 ; CHECK-LABEL: sub32_reg_imm:
60 ; CHECK: sbci r23, 205
63 %result = sub i32 %a, 123456789
67 define i64 @sub64_reg_reg(i64 %a, i64 %b) {
68 ; CHECK-LABEL: sub64_reg_reg:
76 %result = sub i64 %a, %b
80 define i64 @sub64_reg_imm(i64 %a) {
81 ; CHECK-LABEL: sub64_reg_imm:
82 ; CHECK: subi r18, 204
83 ; CHECK: sbci r19, 204
84 ; CHECK: sbci r20, 104
88 ; CHECK: sbci r24, 236
89 ; CHECK: sbci r25, 190
90 %result = sub i64 %a, 13757395258967641292