Changeset View
Changeset View
Standalone View
Standalone View
lib/Target/Hexagon/HexagonPatterns.td
Show First 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
// Frags for commonly used SDNodes. | // Frags for commonly used SDNodes. | ||||
def Add: pf2<add>; def And: pf2<and>; def Sra: pf2<sra>; | def Add: pf2<add>; def And: pf2<and>; def Sra: pf2<sra>; | ||||
def Sub: pf2<sub>; def Or: pf2<or>; def Srl: pf2<srl>; | def Sub: pf2<sub>; def Or: pf2<or>; def Srl: pf2<srl>; | ||||
def Mul: pf2<mul>; def Xor: pf2<xor>; def Shl: pf2<shl>; | def Mul: pf2<mul>; def Xor: pf2<xor>; def Shl: pf2<shl>; | ||||
def Rol: pf2<rotl>; | |||||
// --(1) Immediate ------------------------------------------------------- | // --(1) Immediate ------------------------------------------------------- | ||||
// | // | ||||
def SDTHexagonCONST32 | def SDTHexagonCONST32 | ||||
: SDTypeProfile<1, 1, [SDTCisVT<0, i32>, SDTCisVT<1, i32>, SDTCisPtrTy<0>]>; | : SDTypeProfile<1, 1, [SDTCisVT<0, i32>, SDTCisVT<1, i32>, SDTCisPtrTy<0>]>; | ||||
def HexagonJT: SDNode<"HexagonISD::JT", SDTIntUnaryOp>; | def HexagonJT: SDNode<"HexagonISD::JT", SDTIntUnaryOp>; | ||||
▲ Show 20 Lines • Show All 672 Lines • ▼ Show 20 Lines | |||||
def: OpR_RR_pat<S2_asr_r_r, Sra, i32, I32, I32>; | def: OpR_RR_pat<S2_asr_r_r, Sra, i32, I32, I32>; | ||||
def: OpR_RR_pat<S2_lsr_r_r, Srl, i32, I32, I32>; | def: OpR_RR_pat<S2_lsr_r_r, Srl, i32, I32, I32>; | ||||
def: OpR_RR_pat<S2_asl_r_r, Shl, i32, I32, I32>; | def: OpR_RR_pat<S2_asl_r_r, Shl, i32, I32, I32>; | ||||
def: OpR_RR_pat<S2_asr_r_p, Sra, i64, I64, I32>; | def: OpR_RR_pat<S2_asr_r_p, Sra, i64, I64, I32>; | ||||
def: OpR_RR_pat<S2_lsr_r_p, Srl, i64, I64, I32>; | def: OpR_RR_pat<S2_lsr_r_p, Srl, i64, I64, I32>; | ||||
def: OpR_RR_pat<S2_asl_r_p, Shl, i64, I64, I32>; | def: OpR_RR_pat<S2_asl_r_p, Shl, i64, I64, I32>; | ||||
let Predicates = [HasV60T] in { | |||||
def: OpR_RI_pat<S6_rol_i_r, Rol, i32, I32, u5_0ImmPred>; | |||||
def: OpR_RI_pat<S6_rol_i_p, Rol, i64, I64, u6_0ImmPred>; | |||||
} | |||||
def: Pat<(sra (add (sra I32:$Rs, u5_0ImmPred:$u5), 1), (i32 1)), | def: Pat<(sra (add (sra I32:$Rs, u5_0ImmPred:$u5), 1), (i32 1)), | ||||
(S2_asr_i_r_rnd I32:$Rs, imm:$u5)>; | (S2_asr_i_r_rnd I32:$Rs, imm:$u5)>; | ||||
def: Pat<(sra (add (sra I64:$Rs, u6_0ImmPred:$u6), 1), (i32 1)), | def: Pat<(sra (add (sra I64:$Rs, u6_0ImmPred:$u6), 1), (i32 1)), | ||||
(S2_asr_i_p_rnd I64:$Rs, imm:$u6)>, Requires<[HasV5T]>; | (S2_asr_i_p_rnd I64:$Rs, imm:$u6)>, Requires<[HasV5T]>; | ||||
// Prefer S2_addasl_rrri over S2_asl_i_r_acc. | // Prefer S2_addasl_rrri over S2_asl_i_r_acc. | ||||
let AddedComplexity = 120 in | let AddedComplexity = 120 in | ||||
Show All 29 Lines | let AddedComplexity = 100 in { | ||||
def: AccRRI_pat<S2_asl_i_r_or, Or, Su<Shl>, I32, u5_0ImmPred>; | def: AccRRI_pat<S2_asl_i_r_or, Or, Su<Shl>, I32, u5_0ImmPred>; | ||||
def: AccRRI_pat<S2_asl_i_r_xacc, Xor, Su<Shl>, I32, u5_0ImmPred>; | def: AccRRI_pat<S2_asl_i_r_xacc, Xor, Su<Shl>, I32, u5_0ImmPred>; | ||||
def: AccRRI_pat<S2_asl_i_p_acc, Add, Su<Shl>, I64, u6_0ImmPred>; | def: AccRRI_pat<S2_asl_i_p_acc, Add, Su<Shl>, I64, u6_0ImmPred>; | ||||
def: AccRRI_pat<S2_asl_i_p_nac, Sub, Su<Shl>, I64, u6_0ImmPred>; | def: AccRRI_pat<S2_asl_i_p_nac, Sub, Su<Shl>, I64, u6_0ImmPred>; | ||||
def: AccRRI_pat<S2_asl_i_p_and, And, Su<Shl>, I64, u6_0ImmPred>; | def: AccRRI_pat<S2_asl_i_p_and, And, Su<Shl>, I64, u6_0ImmPred>; | ||||
def: AccRRI_pat<S2_asl_i_p_or, Or, Su<Shl>, I64, u6_0ImmPred>; | def: AccRRI_pat<S2_asl_i_p_or, Or, Su<Shl>, I64, u6_0ImmPred>; | ||||
def: AccRRI_pat<S2_asl_i_p_xacc, Xor, Su<Shl>, I64, u6_0ImmPred>; | def: AccRRI_pat<S2_asl_i_p_xacc, Xor, Su<Shl>, I64, u6_0ImmPred>; | ||||
let Predicates = [HasV60T] in { | |||||
def: AccRRI_pat<S6_rol_i_r_acc, Add, Su<Rol>, I32, u5_0ImmPred>; | |||||
def: AccRRI_pat<S6_rol_i_r_nac, Sub, Su<Rol>, I32, u5_0ImmPred>; | |||||
def: AccRRI_pat<S6_rol_i_r_and, And, Su<Rol>, I32, u5_0ImmPred>; | |||||
def: AccRRI_pat<S6_rol_i_r_or, Or, Su<Rol>, I32, u5_0ImmPred>; | |||||
def: AccRRI_pat<S6_rol_i_r_xacc, Xor, Su<Rol>, I32, u5_0ImmPred>; | |||||
def: AccRRI_pat<S6_rol_i_p_acc, Add, Su<Rol>, I64, u6_0ImmPred>; | |||||
def: AccRRI_pat<S6_rol_i_p_nac, Sub, Su<Rol>, I64, u6_0ImmPred>; | |||||
def: AccRRI_pat<S6_rol_i_p_and, And, Su<Rol>, I64, u6_0ImmPred>; | |||||
def: AccRRI_pat<S6_rol_i_p_or, Or, Su<Rol>, I64, u6_0ImmPred>; | |||||
def: AccRRI_pat<S6_rol_i_p_xacc, Xor, Su<Rol>, I64, u6_0ImmPred>; | |||||
} | |||||
} | } | ||||
let AddedComplexity = 100 in { | let AddedComplexity = 100 in { | ||||
def: AccRRR_pat<S2_asr_r_r_acc, Add, Su<Sra>, I32, I32, I32>; | def: AccRRR_pat<S2_asr_r_r_acc, Add, Su<Sra>, I32, I32, I32>; | ||||
def: AccRRR_pat<S2_asr_r_r_nac, Sub, Su<Sra>, I32, I32, I32>; | def: AccRRR_pat<S2_asr_r_r_nac, Sub, Su<Sra>, I32, I32, I32>; | ||||
def: AccRRR_pat<S2_asr_r_r_and, And, Su<Sra>, I32, I32, I32>; | def: AccRRR_pat<S2_asr_r_r_and, And, Su<Sra>, I32, I32, I32>; | ||||
def: AccRRR_pat<S2_asr_r_r_or, Or, Su<Sra>, I32, I32, I32>; | def: AccRRR_pat<S2_asr_r_r_or, Or, Su<Sra>, I32, I32, I32>; | ||||
▲ Show 20 Lines • Show All 1,899 Lines • Show Last 20 Lines |