mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
ORN does not require (and can not have) the ".w" suffix. "Orthogonality" is a dirty word at ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77275 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
66ad89ceba
commit
1f0962756d
@ -164,23 +164,29 @@ multiclass T2I_un_irs<string opc, PatFrag opnode, bit Cheap = 0, bit ReMat = 0>{
|
|||||||
/// T2I_bin_irs - Defines a set of (op reg, {so_imm|r|so_reg}) patterns for a
|
/// T2I_bin_irs - Defines a set of (op reg, {so_imm|r|so_reg}) patterns for a
|
||||||
// binary operation that produces a value. These are predicable and can be
|
// binary operation that produces a value. These are predicable and can be
|
||||||
/// changed to modify CPSR.
|
/// changed to modify CPSR.
|
||||||
multiclass T2I_bin_irs<string opc, PatFrag opnode, bit Commutable = 0> {
|
multiclass T2I_bin_irs<string opc, PatFrag opnode,
|
||||||
|
bit Commutable = 0, string wide =""> {
|
||||||
// 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, " $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))]>;
|
||||||
// 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, ".w $dst, $lhs, $rhs",
|
opc, !strconcat(wide, " $dst, $lhs, $rhs"),
|
||||||
[(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]> {
|
[(set GPR:$dst, (opnode GPR:$lhs, GPR:$rhs))]> {
|
||||||
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, ".w $dst, $lhs, $rhs",
|
opc, !strconcat(wide, " $dst, $lhs, $rhs"),
|
||||||
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>;
|
[(set GPR:$dst, (opnode GPR:$lhs, t2_so_reg:$rhs))]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// T2I_bin_w_irs - Same as T2I_bin_irs except these operations need
|
||||||
|
// the ".w" prefix to indicate that they are wide.
|
||||||
|
multiclass T2I_bin_w_irs<string opc, PatFrag opnode, bit Commutable = 0> :
|
||||||
|
T2I_bin_irs<opc, opnode, Commutable, ".w">;
|
||||||
|
|
||||||
/// T2I_rbin_is - Same as T2I_bin_irs except the order of operands are
|
/// T2I_rbin_is - Same as T2I_bin_irs except the order of operands are
|
||||||
/// reversed. It doesn't define the 'rr' form since it's handled by its
|
/// reversed. It doesn't define the 'rr' form since it's handled by its
|
||||||
/// T2I_bin_irs counterpart.
|
/// T2I_bin_irs counterpart.
|
||||||
@ -731,11 +737,11 @@ def t2MOVrx : T2sI<(outs GPR:$dst), (ins GPR:$src),
|
|||||||
// Bitwise Instructions.
|
// Bitwise Instructions.
|
||||||
//
|
//
|
||||||
|
|
||||||
defm t2AND : T2I_bin_irs<"and", BinOpFrag<(and node:$LHS, node:$RHS)>, 1>;
|
defm t2AND : T2I_bin_w_irs<"and", BinOpFrag<(and node:$LHS, node:$RHS)>, 1>;
|
||||||
defm t2ORR : T2I_bin_irs<"orr", BinOpFrag<(or node:$LHS, node:$RHS)>, 1>;
|
defm t2ORR : T2I_bin_w_irs<"orr", BinOpFrag<(or node:$LHS, node:$RHS)>, 1>;
|
||||||
defm t2EOR : T2I_bin_irs<"eor", BinOpFrag<(xor node:$LHS, node:$RHS)>, 1>;
|
defm t2EOR : T2I_bin_w_irs<"eor", BinOpFrag<(xor node:$LHS, node:$RHS)>, 1>;
|
||||||
|
|
||||||
defm t2BIC : T2I_bin_irs<"bic", BinOpFrag<(and node:$LHS, (not node:$RHS))>>;
|
defm t2BIC : T2I_bin_w_irs<"bic", BinOpFrag<(and node:$LHS, (not node:$RHS))>>;
|
||||||
|
|
||||||
let Constraints = "$src = $dst" in
|
let Constraints = "$src = $dst" in
|
||||||
def t2BFC : T2I<(outs GPR:$dst), (ins GPR:$src, bf_inv_mask_imm:$imm),
|
def t2BFC : T2I<(outs GPR:$dst), (ins GPR:$src, bf_inv_mask_imm:$imm),
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*$} | count 4
|
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*$} | count 4
|
||||||
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
|
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
|
||||||
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
|
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
|
||||||
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
|
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
|
||||||
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
|
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
|
||||||
|
|
||||||
define i32 @f1(i32 %a, i32 %b) {
|
define i32 @f1(i32 %a, i32 %b) {
|
||||||
%tmp = xor i32 %b, 4294967295
|
%tmp = xor i32 %b, 4294967295
|
||||||
|
Loading…
Reference in New Issue
Block a user