@@ -9036,17 +9036,11 @@ instruct minI_reg_reg(iRegINoSp dst, iRegI src)
9036
9036
match(Set dst (MinI dst src));
9037
9037
9038
9038
ins_cost(BRANCH_COST + ALU_COST);
9039
- format %{
9040
- "ble $dst, $src, skip\t#@minI_reg_reg\n\t"
9041
- "mv $dst, $src\n\t"
9042
- "skip:"
9043
- %}
9039
+ format %{"minI_reg_reg $dst, $dst, $src\t#@minI_reg_reg\n\t"%}
9044
9040
9045
9041
ins_encode %{
9046
- Label Lskip;
9047
- __ ble(as_Register($dst$$reg), as_Register($src$$reg), Lskip);
9048
- __ mv(as_Register($dst$$reg), as_Register($src$$reg));
9049
- __ bind(Lskip);
9042
+ __ cmov_gt(as_Register($dst$$reg), as_Register($src$$reg),
9043
+ as_Register($dst$$reg), as_Register($src$$reg));
9050
9044
%}
9051
9045
9052
9046
ins_pipe(pipe_class_compare);
@@ -9057,17 +9051,11 @@ instruct maxI_reg_reg(iRegINoSp dst, iRegI src)
9057
9051
match(Set dst (MaxI dst src));
9058
9052
9059
9053
ins_cost(BRANCH_COST + ALU_COST);
9060
- format %{
9061
- "bge $dst, $src, skip\t#@maxI_reg_reg\n\t"
9062
- "mv $dst, $src\n\t"
9063
- "skip:"
9064
- %}
9054
+ format %{"maxI_reg_reg $dst, $dst, $src\t#@maxI_reg_reg\n\t"%}
9065
9055
9066
9056
ins_encode %{
9067
- Label Lskip;
9068
- __ bge(as_Register($dst$$reg), as_Register($src$$reg), Lskip);
9069
- __ mv(as_Register($dst$$reg), as_Register($src$$reg));
9070
- __ bind(Lskip);
9057
+ __ cmov_lt(as_Register($dst$$reg), as_Register($src$$reg),
9058
+ as_Register($dst$$reg), as_Register($src$$reg));
9071
9059
%}
9072
9060
9073
9061
ins_pipe(pipe_class_compare);
@@ -9083,17 +9071,11 @@ instruct minI_reg_zero(iRegINoSp dst, immI0 zero)
9083
9071
match(Set dst (MinI zero dst));
9084
9072
9085
9073
ins_cost(BRANCH_COST + ALU_COST);
9086
- format %{
9087
- "blez $dst, skip\t#@minI_reg_zero\n\t"
9088
- "mv $dst, zr\n\t"
9089
- "skip:"
9090
- %}
9074
+ format %{"minI_reg_zero $dst, $dst, zr\t#@minI_reg_zero\n\t"%}
9091
9075
9092
9076
ins_encode %{
9093
- Label Lskip;
9094
- __ blez(as_Register($dst$$reg), Lskip);
9095
- __ mv(as_Register($dst$$reg), zr);
9096
- __ bind(Lskip);
9077
+ __ cmov_gt(as_Register($dst$$reg), zr,
9078
+ as_Register($dst$$reg), zr);
9097
9079
%}
9098
9080
9099
9081
ins_pipe(pipe_class_compare);
@@ -9105,17 +9087,11 @@ instruct maxI_reg_zero(iRegINoSp dst, immI0 zero)
9105
9087
match(Set dst (MaxI zero dst));
9106
9088
9107
9089
ins_cost(BRANCH_COST + ALU_COST);
9108
- format %{
9109
- "bgez $dst, skip\t#@maxI_reg_zero\n\t"
9110
- "mv $dst, zr\n\t"
9111
- "skip:"
9112
- %}
9090
+ format %{"maxI_reg_zero $dst, $dst, zr\t#@maxI_reg_zero\n\t"%}
9113
9091
9114
9092
ins_encode %{
9115
- Label Lskip;
9116
- __ bgez(as_Register($dst$$reg), Lskip);
9117
- __ mv(as_Register($dst$$reg), zr);
9118
- __ bind(Lskip);
9093
+ __ cmov_lt(as_Register($dst$$reg), zr,
9094
+ as_Register($dst$$reg), zr);
9119
9095
%}
9120
9096
9121
9097
ins_pipe(pipe_class_compare);
@@ -9128,23 +9104,12 @@ instruct minI_rReg(iRegINoSp dst, iRegI src1, iRegI src2)
9128
9104
effect(DEF dst, USE src1, USE src2);
9129
9105
9130
9106
ins_cost(BRANCH_COST + ALU_COST * 2);
9131
- format %{
9132
- "ble $src1, $src2, Lsrc1\t#@minI_rReg\n\t"
9133
- "mv $dst, $src2\n\t"
9134
- "j Ldone\n\t"
9135
- "Lsrc1:\n\t"
9136
- "mv $dst, $src1\n\t"
9137
- "Ldone:"
9138
- %}
9107
+ format %{"minI_rReg $dst, $src1, $src2\t#@minI_rReg\n\t"%}
9139
9108
9140
9109
ins_encode %{
9141
- Label Lsrc1, Ldone;
9142
- __ ble(as_Register($src1$$reg), as_Register($src2$$reg), Lsrc1);
9143
- __ mv(as_Register($dst$$reg), as_Register($src2$$reg));
9144
- __ j(Ldone);
9145
- __ bind(Lsrc1);
9146
9110
__ mv(as_Register($dst$$reg), as_Register($src1$$reg));
9147
- __ bind(Ldone);
9111
+ __ cmov_gt(as_Register($src1$$reg), as_Register($src2$$reg),
9112
+ as_Register($dst$$reg), as_Register($src2$$reg));
9148
9113
%}
9149
9114
9150
9115
ins_pipe(pipe_class_compare);
@@ -9157,24 +9122,12 @@ instruct maxI_rReg(iRegINoSp dst, iRegI src1, iRegI src2)
9157
9122
effect(DEF dst, USE src1, USE src2);
9158
9123
9159
9124
ins_cost(BRANCH_COST + ALU_COST * 2);
9160
- format %{
9161
- "bge $src1, $src2, Lsrc1\t#@maxI_rReg\n\t"
9162
- "mv $dst, $src2\n\t"
9163
- "j Ldone\n\t"
9164
- "Lsrc1:\n\t"
9165
- "mv $dst, $src1\n\t"
9166
- "Ldone:"
9167
- %}
9125
+ format %{"maxI_rReg $dst, $src1, $src2\t#@maxI_rReg\n\t"%}
9168
9126
9169
9127
ins_encode %{
9170
- Label Lsrc1, Ldone;
9171
- __ bge(as_Register($src1$$reg), as_Register($src2$$reg), Lsrc1);
9172
- __ mv(as_Register($dst$$reg), as_Register($src2$$reg));
9173
- __ j(Ldone);
9174
- __ bind(Lsrc1);
9175
9128
__ mv(as_Register($dst$$reg), as_Register($src1$$reg));
9176
- __ bind(Ldone);
9177
-
9129
+ __ cmov_lt(as_Register($src1$$reg), as_Register($src2$$reg),
9130
+ as_Register($dst$$reg), as_Register($src2$$reg));
9178
9131
%}
9179
9132
9180
9133
ins_pipe(pipe_class_compare);
0 commit comments