]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/RISCV/addc-adde-sube-subc.ll
Vendor import of llvm trunk r338150:
[FreeBSD/FreeBSD.git] / test / CodeGen / RISCV / addc-adde-sube-subc.ll
1 ; 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
7 define i64 @addc_adde(i64 %a, i64 %b) {
8 ; RV32I-LABEL: addc_adde:
9 ; RV32I:       # %bb.0:
10 ; 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
14 ; RV32I-NEXT:    mv a0, a2
15 ; RV32I-NEXT:    ret
16   %1 = add i64 %a, %b
17   ret i64 %1
18 }
19
20 define i64 @subc_sube(i64 %a, i64 %b) {
21 ; RV32I-LABEL: subc_sube:
22 ; RV32I:       # %bb.0:
23 ; 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
27 ; RV32I-NEXT:    ret
28   %1 = sub i64 %a, %b
29   ret i64 %1
30 }