Use "adcs/sbcs" only when the carry-out is live, otherwise use "adc/sbc".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74321 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Goodwin 2009-06-26 20:45:56 +00:00
parent d8ac1be686
commit 7ce720b448
4 changed files with 7 additions and 7 deletions

View File

@ -236,19 +236,19 @@ let Uses = [CPSR] in {
multiclass T2I_adde_sube_irs<string opc, PatFrag opnode, bit Commutable = 0> { multiclass T2I_adde_sube_irs<string opc, PatFrag opnode, bit Commutable = 0> {
// shifted imm // shifted imm
def ri : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_imm:$rhs), def ri : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_imm:$rhs),
opc, "s $dst, $lhs, $rhs", opc, " $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_imm:$rhs))]>, [(set GPR:$dst, (opnode GPR:$lhs, t2_so_imm:$rhs))]>,
Requires<[IsThumb, HasThumb2, CarryDefIsUnused]>; Requires<[IsThumb, HasThumb2, CarryDefIsUnused]>;
// register // register
def rr : T2sI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs), def rr : T2sI<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
opc, "s $dst, $lhs, $rhs", opc, " $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]>, [(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]>,
Requires<[IsThumb, HasThumb2, CarryDefIsUnused]> { Requires<[IsThumb, HasThumb2, CarryDefIsUnused]> {
let isCommutable = Commutable; let isCommutable = Commutable;
} }
// shifted register // shifted register
def rs : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_reg:$rhs), def rs : T2sI<(outs GPR:$dst), (ins GPR:$lhs, t2_so_reg:$rhs),
opc, "s $dst, $lhs, $rhs", opc, " $dst, $lhs, $rhs",
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>, [(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>,
Requires<[IsThumb, HasThumb2, CarryDefIsUnused]>; Requires<[IsThumb, HasThumb2, CarryDefIsUnused]>;
// Carry setting variants // Carry setting variants

View File

@ -1,6 +1,6 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "subs r" | count 2 ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "subs r" | count 2
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "adcs r" ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "adc r"
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "sbcs r" | count 2 ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "sbc r" | count 2
define i64 @f1(i64 %a, i64 %b) { define i64 @f1(i64 %a, i64 %b) {
entry: entry:

View File

@ -1,4 +1,4 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {adcs\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5 ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {adc\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5
; 734439407617 = 0x000000ab00000001 ; 734439407617 = 0x000000ab00000001
define i64 @f1(i64 %a) { define i64 @f1(i64 %a) {

View File

@ -1,4 +1,4 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {adcs\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]*} | count 1 ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {adc\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]*} | count 1
define i64 @f1(i64 %a, i64 %b) { define i64 @f1(i64 %a, i64 %b) {
%tmp = add i64 %a, %b %tmp = add i64 %a, %b