Skip to content

Commit e106280

Browse files
zifeihanRealFYang
authored andcommitted
8311923: TestIRMatching.java fails on RISC-V
Backport-of: e7adbdb1f1506b82392907f7e4a5c8882d3198eb
1 parent 7f658ce commit e106280

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/hotspot/cpu/riscv/riscv.ad

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,7 +2176,7 @@ bool Matcher::pd_clone_address_expressions(AddPNode* m, Matcher::MStack& mstack,
21762176
encode %{
21772177
// BEGIN Non-volatile memory access
21782178

2179-
enc_class riscv_enc_li_imm(iRegIorL dst, immIorL src) %{
2179+
enc_class riscv_enc_mov_imm(iRegIorL dst, immIorL src) %{
21802180
C2_MacroAssembler _masm(&cbuf);
21812181
int64_t con = (int64_t)$src$$constant;
21822182
Register dst_reg = as_Register($dst$$reg);
@@ -4965,9 +4965,9 @@ instruct loadConI(iRegINoSp dst, immI src)
49654965
match(Set dst src);
49664966

49674967
ins_cost(ALU_COST);
4968-
format %{ "li $dst, $src\t# int, #@loadConI" %}
4968+
format %{ "mv $dst, $src\t# int, #@loadConI" %}
49694969

4970-
ins_encode(riscv_enc_li_imm(dst, src));
4970+
ins_encode(riscv_enc_mov_imm(dst, src));
49714971

49724972
ins_pipe(ialu_imm);
49734973
%}
@@ -4978,9 +4978,9 @@ instruct loadConL(iRegLNoSp dst, immL src)
49784978
match(Set dst src);
49794979

49804980
ins_cost(ALU_COST);
4981-
format %{ "li $dst, $src\t# long, #@loadConL" %}
4981+
format %{ "mv $dst, $src\t# long, #@loadConL" %}
49824982

4983-
ins_encode(riscv_enc_li_imm(dst, src));
4983+
ins_encode(riscv_enc_mov_imm(dst, src));
49844984

49854985
ins_pipe(ialu_imm);
49864986
%}

test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,25 +198,25 @@ public class IRNode {
198198

199199
public static final String ALLOC = PREFIX + "ALLOC" + POSTFIX;
200200
static {
201-
String optoRegex = "(.*precise .*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END;
201+
String optoRegex = "(.*precise .*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END;
202202
allocNodes(ALLOC, "Allocate", optoRegex);
203203
}
204204

205205
public static final String ALLOC_OF = COMPOSITE_PREFIX + "ALLOC_OF" + POSTFIX;
206206
static {
207-
String regex = "(.*precise .*" + IS_REPLACED + ":.*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END;
207+
String regex = "(.*precise .*" + IS_REPLACED + ":.*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END;
208208
optoOnly(ALLOC_OF, regex);
209209
}
210210

211211
public static final String ALLOC_ARRAY = PREFIX + "ALLOC_ARRAY" + POSTFIX;
212212
static {
213-
String optoRegex = "(.*precise \\[.*\\R((.*(?i:mov|xor|nop|spill).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END;
213+
String optoRegex = "(.*precise \\[.*\\R((.*(?i:mov|mv|xor|nop|spill).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END;
214214
allocNodes(ALLOC_ARRAY, "AllocateArray", optoRegex);
215215
}
216216

217217
public static final String ALLOC_ARRAY_OF = COMPOSITE_PREFIX + "ALLOC_ARRAY_OF" + POSTFIX;
218218
static {
219-
String regex = "(.*precise \\[.*" + IS_REPLACED + ":.*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END;
219+
String regex = "(.*precise \\[.*" + IS_REPLACED + ":.*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*|.*(LGHI|LI).*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END;
220220
optoOnly(ALLOC_ARRAY_OF, regex);
221221
}
222222

@@ -277,13 +277,13 @@ public class IRNode {
277277

278278
public static final String CHECKCAST_ARRAY = PREFIX + "CHECKCAST_ARRAY" + POSTFIX;
279279
static {
280-
String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*:|.*(?i:mov|or).*precise \\[.*:.*\\R.*(cmp|CMP|CLR))" + END;
280+
String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*:|.*(?i:mov|mv|or).*precise \\[.*:.*\\R.*(cmp|CMP|CLR))" + END;
281281
optoOnly(CHECKCAST_ARRAY, regex);
282282
}
283283

284284
public static final String CHECKCAST_ARRAY_OF = COMPOSITE_PREFIX + "CHECKCAST_ARRAY_OF" + POSTFIX;
285285
static {
286-
String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*" + IS_REPLACED + ":|.*(?i:mov|or).*precise \\[.*" + IS_REPLACED + ":.*\\R.*(cmp|CMP|CLR))" + END;
286+
String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*" + IS_REPLACED + ":|.*(?i:mov|mv|or).*precise \\[.*" + IS_REPLACED + ":.*\\R.*(cmp|CMP|CLR))" + END;
287287
optoOnly(CHECKCAST_ARRAY_OF, regex);
288288
}
289289

0 commit comments

Comments
 (0)