blob: 7c28df4c30ff3a5b4e09309ec3b54d7ae08c7789 [file] [log] [blame]
Alex Bradburyffc435e2017-11-21 08:11:03 +00001; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3; RUN: | FileCheck -check-prefix=RV32I %s
4
5; Ensure that the ISDOpcodes ADDC, ADDE, SUBC, SUBE are handled correctly
6
7define i64 @addc_adde(i64 %a, i64 %b) {
8; RV32I-LABEL: addc_adde:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +00009; RV32I: # %bb.0:
Alex Bradburyffc435e2017-11-21 08:11:03 +000010; RV32I-NEXT: add a1, a1, a3
11; RV32I-NEXT: add a2, a0, a2
12; RV32I-NEXT: sltu a0, a2, a0
13; RV32I-NEXT: add a1, a1, a0
Alex Bradbury59136ff2017-12-15 09:47:01 +000014; RV32I-NEXT: mv a0, a2
Alex Bradbury59136ff2017-12-15 09:47:01 +000015; RV32I-NEXT: ret
Alex Bradburyffc435e2017-11-21 08:11:03 +000016 %1 = add i64 %a, %b
17 ret i64 %1
18}
19
20define i64 @subc_sube(i64 %a, i64 %b) {
21; RV32I-LABEL: subc_sube:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000022; RV32I: # %bb.0:
Alex Bradburyffc435e2017-11-21 08:11:03 +000023; RV32I-NEXT: sub a1, a1, a3
24; RV32I-NEXT: sltu a3, a0, a2
25; RV32I-NEXT: sub a1, a1, a3
26; RV32I-NEXT: sub a0, a0, a2
Alex Bradbury59136ff2017-12-15 09:47:01 +000027; RV32I-NEXT: ret
Alex Bradburyffc435e2017-11-21 08:11:03 +000028 %1 = sub i64 %a, %b
29 ret i64 %1
30}