@@ -117,8 +117,8 @@ def usat: PatFrag<(ops node:$V, node:$Ty), (HexagonUSAT node:$V, node:$Ty)>;
117
117
118
118
// Pattern fragments to extract the low and high subregisters from a
119
119
// 64-bit value.
120
- def LoReg: OutPatFrag<(ops node:$Rs), (EXTRACT_SUBREG (i64 $Rs) , isub_lo)>;
121
- def HiReg: OutPatFrag<(ops node:$Rs), (EXTRACT_SUBREG (i64 $Rs) , isub_hi)>;
120
+ def LoReg: OutPatFrag<(ops node:$Rs), (EXTRACT_SUBREG $Rs, isub_lo)>;
121
+ def HiReg: OutPatFrag<(ops node:$Rs), (EXTRACT_SUBREG $Rs, isub_hi)>;
122
122
123
123
def IsOrAdd: PatFrag<(ops node:$A, node:$B), (or node:$A, node:$B), [{
124
124
return isOrEquivalentToAdd(N);
@@ -1123,6 +1123,12 @@ def: Pat<(bswap I32:$Rs), (A2_swiz I32:$Rs)>;
1123
1123
def: Pat<(bswap I64:$Rss), (Combinew (A2_swiz (LoReg $Rss)),
1124
1124
(A2_swiz (HiReg $Rss)))>;
1125
1125
1126
+ def: Pat<(bswap V2I16:$Rs), (A2_combine_lh (A2_swiz $Rs), (A2_swiz $Rs))>;
1127
+ def: Pat<(bswap V2I32:$Rs), (Combinew (A2_swiz (HiReg $Rs)),
1128
+ (A2_swiz (LoReg $Rs)))>;
1129
+ def: Pat<(bswap V4I16:$Rs), (A2_orp (S2_lsr_i_vh $Rs, 8),
1130
+ (S2_asl_i_vh $Rs, 8))>;
1131
+
1126
1132
def: Pat<(shl s6_0ImmPred:$s6, I32:$Rt), (S4_lsli imm:$s6, I32:$Rt)>;
1127
1133
def: Pat<(shl I32:$Rs, (i32 16)), (A2_aslh I32:$Rs)>;
1128
1134
def: Pat<(sra I32:$Rs, (i32 16)), (A2_asrh I32:$Rs)>;
@@ -1854,6 +1860,20 @@ def: Pat<(i32 (ctpop I32:$Rs)), (S5_popcountp (A4_combineir 0, I32:$Rs))>;
1854
1860
def: Pat<(bitreverse I32:$Rs), (S2_brev I32:$Rs)>;
1855
1861
def: Pat<(bitreverse I64:$Rss), (S2_brevp I64:$Rss)>;
1856
1862
1863
+ def: Pat<(bitreverse V4I8:$Rs), (A2_swiz (S2_brev $Rs))>;
1864
+ def: Pat<(bitreverse V8I8:$Rs), (Combinew (A2_swiz (LoReg (S2_brevp $Rs))),
1865
+ (A2_swiz (HiReg (S2_brevp $Rs))))>;
1866
+ def: Pat<(bitreverse V2I16:$Rs), (A2_combine_lh (S2_brev $Rs),
1867
+ (S2_brev $Rs))>;
1868
+ def: Pat<(bitreverse V4I16:$Rs),
1869
+ (Combinew (A2_combine_lh (LoReg (S2_brevp $Rs)),
1870
+ (LoReg (S2_brevp $Rs))),
1871
+ (A2_combine_lh (HiReg (S2_brevp $Rs)),
1872
+ (HiReg (S2_brevp $Rs))))>;
1873
+ def: Pat<(bitreverse V2I32:$Rs),
1874
+ (Combinew (i32 (LoReg (S2_brevp $Rs))),
1875
+ (i32 (HiReg (S2_brevp $Rs))))>;
1876
+
1857
1877
let AddedComplexity = 20 in { // Complexity greater than and/or/xor
1858
1878
def: Pat<(and I32:$Rs, IsNPow2_32:$V),
1859
1879
(S2_clrbit_i IntRegs:$Rs, (LogN2_32 $V))>;
0 commit comments