Skip to content

Commit 50f8adb

Browse files
committed
[RISCV] Accept '0(reg)' in addition to '(reg)' ifor vl1r.v/vl2r.v/vl4r.v/vl8r.v
This matches vl1re8.v, vl2re8.v, vl4re8.v, vl8re8.v.
1 parent cb1d640 commit 50f8adb

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoV.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,10 +1125,10 @@ def VS4R_V : VWholeStore<3, "vs4r.v", VRM4>,
11251125
def VS8R_V : VWholeStore<7, "vs8r.v", VRM8>,
11261126
Sched<[WriteVST8R, ReadVST8R, ReadVSTX]>;
11271127

1128-
def : InstAlias<"vl1r.v $vd, (${rs1})", (VL1RE8_V VR:$vd, GPR:$rs1)>;
1129-
def : InstAlias<"vl2r.v $vd, (${rs1})", (VL2RE8_V VRM2:$vd, GPR:$rs1)>;
1130-
def : InstAlias<"vl4r.v $vd, (${rs1})", (VL4RE8_V VRM4:$vd, GPR:$rs1)>;
1131-
def : InstAlias<"vl8r.v $vd, (${rs1})", (VL8RE8_V VRM8:$vd, GPR:$rs1)>;
1128+
def : InstAlias<"vl1r.v $vd, $rs1", (VL1RE8_V VR:$vd, GPRMemZeroOffset:$rs1)>;
1129+
def : InstAlias<"vl2r.v $vd, $rs1", (VL2RE8_V VRM2:$vd, GPRMemZeroOffset:$rs1)>;
1130+
def : InstAlias<"vl4r.v $vd, $rs1", (VL4RE8_V VRM4:$vd, GPRMemZeroOffset:$rs1)>;
1131+
def : InstAlias<"vl8r.v $vd, $rs1", (VL8RE8_V VRM8:$vd, GPRMemZeroOffset:$rs1)>;
11321132
} // Predicates = [HasVInstructions]
11331133

11341134
let Predicates = [HasVInstructions] in {

llvm/test/MC/RISCV/rvv/aliases.s

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,28 @@ vmset.m v0
5656
vmnot.m v0, v1
5757
# ALIAS: vl1r.v v0, (a0) # encoding: [0x07,0x00,0x85,0x02]
5858
# NO-ALIAS: vl1re8.v v0, (a0) # encoding: [0x07,0x00,0x85,0x02]
59-
vl1r.v v0, (a0)
59+
vl1r.v v0, (a0)
60+
# ALIAS: vl1r.v v0, (a0) # encoding: [0x07,0x00,0x85,0x02]
61+
# NO-ALIAS: vl1re8.v v0, (a0) # encoding: [0x07,0x00,0x85,0x02]
62+
vl1r.v v0, 0(a0)
63+
# ALIAS: vl2r.v v0, (a0) # encoding: [0x07,0x00,0x85,0x22]
64+
# NO-ALIAS: vl2re8.v v0, (a0) # encoding: [0x07,0x00,0x85,0x22]
65+
vl2r.v v0, (a0)
6066
# ALIAS: vl2r.v v0, (a0) # encoding: [0x07,0x00,0x85,0x22]
6167
# NO-ALIAS: vl2re8.v v0, (a0) # encoding: [0x07,0x00,0x85,0x22]
62-
vl2r.v v0, (a0)
68+
vl2r.v v0, 0(a0)
6369
# ALIAS: vl4r.v v0, (a0) # encoding: [0x07,0x00,0x85,0x62]
6470
# NO-ALIAS: vl4re8.v v0, (a0) # encoding: [0x07,0x00,0x85,0x62]
65-
vl4r.v v0, (a0)
71+
vl4r.v v0, (a0)
72+
# ALIAS: vl4r.v v0, (a0) # encoding: [0x07,0x00,0x85,0x62]
73+
# NO-ALIAS: vl4re8.v v0, (a0) # encoding: [0x07,0x00,0x85,0x62]
74+
vl4r.v v0, 0(a0)
75+
# ALIAS: vl8r.v v0, (a0) # encoding: [0x07,0x00,0x85,0xe2]
76+
# NO-ALIAS: vl8re8.v v0, (a0) # encoding: [0x07,0x00,0x85,0xe2]
77+
vl8r.v v0, (a0)
6678
# ALIAS: vl8r.v v0, (a0) # encoding: [0x07,0x00,0x85,0xe2]
6779
# NO-ALIAS: vl8re8.v v0, (a0) # encoding: [0x07,0x00,0x85,0xe2]
68-
vl8r.v v0, (a0)
80+
vl8r.v v0, 0(a0)
6981
# ALIAS: vneg.v v2, v1, v0.t # encoding: [0x57,0x41,0x10,0x0c]
7082
# NO-ALIAS: vrsub.vx v2, v1, zero, v0.t # encoding: [0x57,0x41,0x10,0x0c]
7183
vneg.v v2, v1, v0.t

0 commit comments

Comments
 (0)