Skip to content

Commit 3ad6aef

Browse files
feilongjiangRealFYang
authored andcommitted
8301313: RISC-V: C2: assert(false) failed: bad AD file due to missing match rule
Reviewed-by: fyang, yadongwang
1 parent 4c9de87 commit 3ad6aef

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

src/hotspot/cpu/riscv/riscv.ad

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10044,6 +10044,23 @@ instruct cmovI_cmpL(iRegINoSp dst, iRegI src, iRegL op1, iRegL op2, cmpOp cop) %
1004410044
ins_pipe(pipe_class_compare);
1004510045
%}
1004610046

10047+
instruct cmovI_cmpUL(iRegINoSp dst, iRegI src, iRegL op1, iRegL op2, cmpOpU cop) %{
10048+
match(Set dst (CMoveI (Binary cop (CmpUL op1 op2)) (Binary dst src)));
10049+
ins_cost(ALU_COST + BRANCH_COST);
10050+
10051+
format %{
10052+
"CMove $dst, ($op1 $cop $op2), $dst, $src\t#@cmovI_cmpUL\n\t"
10053+
%}
10054+
10055+
ins_encode %{
10056+
__ enc_cmove($cop$$cmpcode | C2_MacroAssembler::unsigned_branch_mask,
10057+
as_Register($op1$$reg), as_Register($op2$$reg),
10058+
as_Register($dst$$reg), as_Register($src$$reg));
10059+
%}
10060+
10061+
ins_pipe(pipe_class_compare);
10062+
%}
10063+
1004710064
instruct cmovL_cmpL(iRegLNoSp dst, iRegL src, iRegL op1, iRegL op2, cmpOp cop) %{
1004810065
match(Set dst (CMoveL (Binary cop (CmpL op1 op2)) (Binary dst src)));
1004910066
ins_cost(ALU_COST + BRANCH_COST);
@@ -10078,23 +10095,39 @@ instruct cmovL_cmpUL(iRegLNoSp dst, iRegL src, iRegL op1, iRegL op2, cmpOpU cop)
1007810095
ins_pipe(pipe_class_compare);
1007910096
%}
1008010097

10081-
instruct cmovI_cmpUL(iRegINoSp dst, iRegI src, iRegL op1, iRegL op2, cmpOpU cop) %{
10082-
match(Set dst (CMoveI (Binary cop (CmpUL op1 op2)) (Binary dst src)));
10098+
instruct cmovL_cmpI(iRegLNoSp dst, iRegL src, iRegI op1, iRegI op2, cmpOp cop) %{
10099+
match(Set dst (CMoveL (Binary cop (CmpI op1 op2)) (Binary dst src)));
1008310100
ins_cost(ALU_COST + BRANCH_COST);
1008410101

1008510102
format %{
10086-
"CMove $dst, ($op1 $cop $op2), $dst, $src\t#@cmovI_cmpUL\n\t"
10103+
"CMove $dst, ($op1 $cop $op2), $dst, $src\t#@cmovL_cmpI\n\t"
1008710104
%}
1008810105

1008910106
ins_encode %{
10090-
__ enc_cmove($cop$$cmpcode | C2_MacroAssembler::unsigned_branch_mask,
10107+
__ enc_cmove($cop$$cmpcode,
1009110108
as_Register($op1$$reg), as_Register($op2$$reg),
1009210109
as_Register($dst$$reg), as_Register($src$$reg));
1009310110
%}
1009410111

1009510112
ins_pipe(pipe_class_compare);
1009610113
%}
1009710114

10115+
instruct cmovL_cmpU(iRegLNoSp dst, iRegL src, iRegI op1, iRegI op2, cmpOpU cop) %{
10116+
match(Set dst (CMoveL (Binary cop (CmpU op1 op2)) (Binary dst src)));
10117+
ins_cost(ALU_COST + BRANCH_COST);
10118+
10119+
format %{
10120+
"CMove $dst, ($op1 $cop $op2), $dst, $src\t#@cmovL_cmpU\n\t"
10121+
%}
10122+
10123+
ins_encode %{
10124+
__ enc_cmove($cop$$cmpcode | C2_MacroAssembler::unsigned_branch_mask,
10125+
as_Register($op1$$reg), as_Register($op2$$reg),
10126+
as_Register($dst$$reg), as_Register($src$$reg));
10127+
%}
10128+
10129+
ins_pipe(pipe_class_compare);
10130+
%}
1009810131

1009910132
// ============================================================================
1010010133
// Procedure Call/Return Instructions

0 commit comments

Comments
 (0)