Skip to content

Commit ec01b29

Browse files
committed
[ARM] Fix MVE_VQxDMLxDH instruction class
Summary: According to the ARMARM, the VQDMLADH, VQRDMLADH, VQDMLSDH and VQRDMLSDH instructions handle their results as follows: "The base variant writes the results into the lower element of each pair of elements in the destination register, whereas the exchange variant writes to the upper element in each pair". I.e., the initial content of the output register affects the result, as usual, we model this with an additional input. Also, for 32-bit variants Qd is not allowed to be the same register as Qm and Qn, we use @earlyclobber to indicate this. This patch also changes vpred_r to vpred_n because the instructions don't have an explicit 'inactive' operand. Reviewers: dmgreen, ostannard, simon_tatham Reviewed By: simon_tatham Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64007 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364796 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent ebb2f49 commit ec01b29

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lib/Target/ARM/ARMInstrMVE.td

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,10 +2747,13 @@ class MVE_qDest_qSrc<string iname, string suffix, dag oops, dag iops,
27472747
}
27482748

27492749
class MVE_VQxDMLxDH<string iname, bit exch, bit round, bit subtract,
2750-
string suffix, bits<2> size, list<dag> pattern=[]>
2750+
string suffix, bits<2> size, bit earlyclobber,
2751+
list<dag> pattern=[]>
27512752
: MVE_qDest_qSrc<iname, suffix, (outs MQPR:$Qd),
2752-
(ins MQPR:$Qn, MQPR:$Qm), "$Qd, $Qn, $Qm",
2753-
vpred_r, "", pattern> {
2753+
(ins MQPR:$Qd_src, MQPR:$Qn, MQPR:$Qm), "$Qd, $Qn, $Qm",
2754+
vpred_n,
2755+
!if(earlyclobber, "@earlyclobber $Qd,", "") # "$Qd = $Qd_src",
2756+
pattern> {
27542757
bits<4> Qn;
27552758

27562759
let Inst{28} = subtract;
@@ -2765,9 +2768,9 @@ class MVE_VQxDMLxDH<string iname, bit exch, bit round, bit subtract,
27652768

27662769
multiclass MVE_VQxDMLxDH_multi<string iname, bit exch,
27672770
bit round, bit subtract> {
2768-
def s8 : MVE_VQxDMLxDH<iname, exch, round, subtract, "s8", 0b00>;
2769-
def s16 : MVE_VQxDMLxDH<iname, exch, round, subtract, "s16", 0b01>;
2770-
def s32 : MVE_VQxDMLxDH<iname, exch, round, subtract, "s32", 0b10>;
2771+
def s8 : MVE_VQxDMLxDH<iname, exch, round, subtract, "s8", 0b00, 0b0>;
2772+
def s16 : MVE_VQxDMLxDH<iname, exch, round, subtract, "s16", 0b01, 0b0>;
2773+
def s32 : MVE_VQxDMLxDH<iname, exch, round, subtract, "s32", 0b10, 0b1>;
27712774
}
27722775

27732776
defm MVE_VQDMLADH : MVE_VQxDMLxDH_multi<"vqdmladh", 0b0, 0b0, 0b0>;

0 commit comments

Comments
 (0)