aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbackman <none@none>2014-01-23 12:08:28 +0100
committerrbackman <none@none>2014-01-23 12:08:28 +0100
commit3bda9c103b7ab08984a13c4b985d7b70afa6a8ee (patch)
tree76685fa4d3305a50ba0182718acf1c36594a8f9d
parent5060f8d1134ff76bdd2988336b47b1be7cb104c3 (diff)
8027754: Enable loop optimizations for loops with MathExact inside
Reviewed-by: kvn, iveresov
-rw-r--r--src/cpu/sparc/vm/sparc.ad13
-rw-r--r--src/cpu/x86/vm/x86_32.ad224
-rw-r--r--src/cpu/x86/vm/x86_64.ad435
-rw-r--r--src/share/vm/adlc/archDesc.cpp15
-rw-r--r--src/share/vm/opto/c2_globals.hpp2
-rw-r--r--src/share/vm/opto/classes.hpp18
-rw-r--r--src/share/vm/opto/compile.cpp36
-rw-r--r--src/share/vm/opto/ifnode.cpp1
-rw-r--r--src/share/vm/opto/lcm.cpp7
-rw-r--r--src/share/vm/opto/library_call.cpp130
-rw-r--r--src/share/vm/opto/loopTransform.cpp8
-rw-r--r--src/share/vm/opto/loopopts.cpp9
-rw-r--r--src/share/vm/opto/matcher.cpp1
-rw-r--r--src/share/vm/opto/matcher.hpp4
-rw-r--r--src/share/vm/opto/mathexactnode.cpp503
-rw-r--r--src/share/vm/opto/mathexactnode.hpp141
-rw-r--r--src/share/vm/opto/multnode.cpp5
-rw-r--r--src/share/vm/opto/node.hpp6
-rw-r--r--src/share/vm/opto/subnode.cpp6
-rw-r--r--src/share/vm/opto/type.cpp4
-rw-r--r--src/share/vm/opto/type.hpp11
-rw-r--r--src/share/vm/runtime/vmStructs.cpp18
-rw-r--r--test/compiler/intrinsics/mathexact/AddExactICondTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/AddExactIConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/AddExactILoadTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/AddExactLConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/CompareTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/DecExactITest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/DecExactLTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/GVNTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/IncExactITest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/IncExactLTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/MulExactICondTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/MulExactIConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/MulExactILoadTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/MulExactLConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/NegExactIConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/NegExactILoadTest.java6
-rw-r--r--test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/NegExactLConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/NestedMathExactTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/SplitThruPhiTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/SubExactICondTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/SubExactIConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/SubExactILoadTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/SubExactLConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java2
-rw-r--r--test/compiler/intrinsics/mathexact/Verify.java5
-rw-r--r--test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java4
-rw-r--r--test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java4
-rw-r--r--test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java4
-rw-r--r--test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java6
-rw-r--r--test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java4
-rw-r--r--test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java4
-rw-r--r--test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java4
-rw-r--r--test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java4
-rw-r--r--test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java4
-rw-r--r--test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java4
-rw-r--r--test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java4
-rw-r--r--test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java4
73 files changed, 625 insertions, 1107 deletions
diff --git a/src/cpu/sparc/vm/sparc.ad b/src/cpu/sparc/vm/sparc.ad
index 535995135..3d1501e79 100644
--- a/src/cpu/sparc/vm/sparc.ad
+++ b/src/cpu/sparc/vm/sparc.ad
@@ -2029,19 +2029,6 @@ const RegMask Matcher::method_handle_invoke_SP_save_mask() {
return L7_REGP_mask();
}
-const RegMask Matcher::mathExactI_result_proj_mask() {
- return G1_REGI_mask();
-}
-
-const RegMask Matcher::mathExactL_result_proj_mask() {
- return G1_REGL_mask();
-}
-
-const RegMask Matcher::mathExactI_flags_proj_mask() {
- return INT_FLAGS_mask();
-}
-
-
%}
diff --git a/src/cpu/x86/vm/x86_32.ad b/src/cpu/x86/vm/x86_32.ad
index 382d09b07..f4a68abc7 100644
--- a/src/cpu/x86/vm/x86_32.ad
+++ b/src/cpu/x86/vm/x86_32.ad
@@ -1534,19 +1534,6 @@ const RegMask Matcher::method_handle_invoke_SP_save_mask() {
return EBP_REG_mask();
}
-const RegMask Matcher::mathExactI_result_proj_mask() {
- return EAX_REG_mask();
-}
-
-const RegMask Matcher::mathExactL_result_proj_mask() {
- ShouldNotReachHere();
- return RegMask();
-}
-
-const RegMask Matcher::mathExactI_flags_proj_mask() {
- return INT_FLAGS_mask();
-}
-
// Returns true if the high 32 bits of the value is known to be zero.
bool is_operand_hi32_zero(Node* n) {
int opc = n->Opcode();
@@ -6999,44 +6986,6 @@ instruct cmovL_regUCF(cmpOpUCF cop, eFlagsRegUCF cr, eRegL dst, eRegL src) %{
//----------Arithmetic Instructions--------------------------------------------
//----------Addition Instructions----------------------------------------------
-instruct addExactI_eReg(eAXRegI dst, rRegI src, eFlagsReg cr)
-%{
- match(AddExactI dst src);
- effect(DEF cr);
-
- format %{ "ADD $dst, $src\t# addExact int" %}
- ins_encode %{
- __ addl($dst$$Register, $src$$Register);
- %}
- ins_pipe(ialu_reg_reg);
-%}
-
-instruct addExactI_eReg_imm(eAXRegI dst, immI src, eFlagsReg cr)
-%{
- match(AddExactI dst src);
- effect(DEF cr);
-
- format %{ "ADD $dst, $src\t# addExact int" %}
- ins_encode %{
- __ addl($dst$$Register, $src$$constant);
- %}
- ins_pipe(ialu_reg_reg);
-%}
-
-instruct addExactI_eReg_mem(eAXRegI dst, memory src, eFlagsReg cr)
-%{
- match(AddExactI dst (LoadI src));
- effect(DEF cr);
-
- ins_cost(125);
- format %{ "ADD $dst,$src\t# addExact int" %}
- ins_encode %{
- __ addl($dst$$Register, $src$$Address);
- %}
- ins_pipe( ialu_reg_mem );
-%}
-
-
// Integer Addition Instructions
instruct addI_eReg(rRegI dst, rRegI src, eFlagsReg cr) %{
match(Set dst (AddI dst src));
@@ -7346,43 +7295,6 @@ instruct xchgP( memory mem, pRegP newval) %{
//----------Subtraction Instructions-------------------------------------------
-instruct subExactI_eReg(eAXRegI dst, rRegI src, eFlagsReg cr)
-%{
- match(SubExactI dst src);
- effect(DEF cr);
-
- format %{ "SUB $dst, $src\t# subExact int" %}
- ins_encode %{
- __ subl($dst$$Register, $src$$Register);
- %}
- ins_pipe(ialu_reg_reg);
-%}
-
-instruct subExactI_eReg_imm(eAXRegI dst, immI src, eFlagsReg cr)
-%{
- match(SubExactI dst src);
- effect(DEF cr);
-
- format %{ "SUB $dst, $src\t# subExact int" %}
- ins_encode %{
- __ subl($dst$$Register, $src$$constant);
- %}
- ins_pipe(ialu_reg_reg);
-%}
-
-instruct subExactI_eReg_mem(eAXRegI dst, memory src, eFlagsReg cr)
-%{
- match(SubExactI dst (LoadI src));
- effect(DEF cr);
-
- ins_cost(125);
- format %{ "SUB $dst,$src\t# subExact int" %}
- ins_encode %{
- __ subl($dst$$Register, $src$$Address);
- %}
- ins_pipe( ialu_reg_mem );
-%}
-
// Integer Subtraction Instructions
instruct subI_eReg(rRegI dst, rRegI src, eFlagsReg cr) %{
match(Set dst (SubI dst src));
@@ -7451,17 +7363,6 @@ instruct negI_eReg(rRegI dst, immI0 zero, eFlagsReg cr) %{
ins_pipe( ialu_reg );
%}
-instruct negExactI_eReg(eAXRegI dst, eFlagsReg cr) %{
- match(NegExactI dst);
- effect(DEF cr);
-
- format %{ "NEG $dst\t# negExact int"%}
- ins_encode %{
- __ negl($dst$$Register);
- %}
- ins_pipe(ialu_reg);
-%}
-
//----------Multiplication/Division Instructions-------------------------------
// Integer Multiplication Instructions
// Multiply Register
@@ -7673,46 +7574,6 @@ instruct mulL_eReg_con(eADXRegL dst, immL_127 src, rRegI tmp, eFlagsReg cr) %{
ins_pipe( pipe_slow );
%}
-instruct mulExactI_eReg(eAXRegI dst, rRegI src, eFlagsReg cr)
-%{
- match(MulExactI dst src);
- effect(DEF cr);
-
- ins_cost(300);
- format %{ "IMUL $dst, $src\t# mulExact int" %}
- ins_encode %{
- __ imull($dst$$Register, $src$$Register);
- %}
- ins_pipe(ialu_reg_reg_alu0);
-%}
-
-instruct mulExactI_eReg_imm(eAXRegI dst, rRegI src, immI imm, eFlagsReg cr)
-%{
- match(MulExactI src imm);
- effect(DEF cr);
-
- ins_cost(300);
- format %{ "IMUL $dst, $src, $imm\t# mulExact int" %}
- ins_encode %{
- __ imull($dst$$Register, $src$$Register, $imm$$constant);
- %}
- ins_pipe(ialu_reg_reg_alu0);
-%}
-
-instruct mulExactI_eReg_mem(eAXRegI dst, memory src, eFlagsReg cr)
-%{
- match(MulExactI dst (LoadI src));
- effect(DEF cr);
-
- ins_cost(350);
- format %{ "IMUL $dst, $src\t# mulExact int" %}
- ins_encode %{
- __ imull($dst$$Register, $src$$Address);
- %}
- ins_pipe(ialu_reg_mem_alu0);
-%}
-
-
// Integer DIV with Register
instruct divI_eReg(eAXRegI rax, eDXRegI rdx, eCXRegI div, eFlagsReg cr) %{
match(Set rax (DivI rax div));
@@ -8578,6 +8439,91 @@ instruct and_cmpLTMask(rRegI p, rRegI q, rRegI y, eFlagsReg cr) %{
instruct cadd_cmpLTMask_mem(ncxRegI p, ncxRegI q, memory y, eCXRegI tmp, eFlagsReg cr) %{
match(Set p (AddI (AndI (CmpLTMask p q) (LoadI y)) (SubI p q)));
*/
+//----------Overflow Math Instructions-----------------------------------------
+
+instruct overflowAddI_eReg(eFlagsReg cr, eAXRegI op1, rRegI op2)
+%{
+ match(Set cr (OverflowAddI op1 op2));
+ effect(DEF cr, USE_KILL op1, USE op2);
+
+ format %{ "ADD $op1, $op2\t# overflow check int" %}
+
+ ins_encode %{
+ __ addl($op1$$Register, $op2$$Register);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowAddI_rReg_imm(eFlagsReg cr, eAXRegI op1, immI op2)
+%{
+ match(Set cr (OverflowAddI op1 op2));
+ effect(DEF cr, USE_KILL op1, USE op2);
+
+ format %{ "ADD $op1, $op2\t# overflow check int" %}
+
+ ins_encode %{
+ __ addl($op1$$Register, $op2$$constant);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowSubI_rReg(eFlagsReg cr, rRegI op1, rRegI op2)
+%{
+ match(Set cr (OverflowSubI op1 op2));
+
+ format %{ "CMP $op1, $op2\t# overflow check int" %}
+ ins_encode %{
+ __ cmpl($op1$$Register, $op2$$Register);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowSubI_rReg_imm(eFlagsReg cr, rRegI op1, immI op2)
+%{
+ match(Set cr (OverflowSubI op1 op2));
+
+ format %{ "CMP $op1, $op2\t# overflow check int" %}
+ ins_encode %{
+ __ cmpl($op1$$Register, $op2$$constant);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowNegI_rReg(eFlagsReg cr, immI0 zero, eAXRegI op2)
+%{
+ match(Set cr (OverflowSubI zero op2));
+ effect(DEF cr, USE_KILL op2);
+
+ format %{ "NEG $op2\t# overflow check int" %}
+ ins_encode %{
+ __ negl($op2$$Register);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowMulI_rReg(eFlagsReg cr, eAXRegI op1, rRegI op2)
+%{
+ match(Set cr (OverflowMulI op1 op2));
+ effect(DEF cr, USE_KILL op1, USE op2);
+
+ format %{ "IMUL $op1, $op2\t# overflow check int" %}
+ ins_encode %{
+ __ imull($op1$$Register, $op2$$Register);
+ %}
+ ins_pipe(ialu_reg_reg_alu0);
+%}
+
+instruct overflowMulI_rReg_imm(eFlagsReg cr, rRegI op1, immI op2, rRegI tmp)
+%{
+ match(Set cr (OverflowMulI op1 op2));
+ effect(DEF cr, TEMP tmp, USE op1, USE op2);
+
+ format %{ "IMUL $tmp, $op1, $op2\t# overflow check int" %}
+ ins_encode %{
+ __ imull($tmp$$Register, $op1$$Register, $op2$$constant);
+ %}
+ ins_pipe(ialu_reg_reg_alu0);
+%}
//----------Long Instructions------------------------------------------------
// Add Long Register with Register
diff --git a/src/cpu/x86/vm/x86_64.ad b/src/cpu/x86/vm/x86_64.ad
index 70b3c5a9e..f82b8f381 100644
--- a/src/cpu/x86/vm/x86_64.ad
+++ b/src/cpu/x86/vm/x86_64.ad
@@ -1649,18 +1649,6 @@ const RegMask Matcher::method_handle_invoke_SP_save_mask() {
return PTR_RBP_REG_mask();
}
-const RegMask Matcher::mathExactI_result_proj_mask() {
- return INT_RAX_REG_mask();
-}
-
-const RegMask Matcher::mathExactL_result_proj_mask() {
- return LONG_RAX_REG_mask();
-}
-
-const RegMask Matcher::mathExactI_flags_proj_mask() {
- return INT_FLAGS_mask();
-}
-
%}
//----------ENCODING BLOCK-----------------------------------------------------
@@ -6728,82 +6716,6 @@ instruct cmovD_regUCF(cmpOpUCF cop, rFlagsRegUCF cr, regD dst, regD src) %{
//----------Arithmetic Instructions--------------------------------------------
//----------Addition Instructions----------------------------------------------
-instruct addExactI_rReg(rax_RegI dst, rRegI src, rFlagsReg cr)
-%{
- match(AddExactI dst src);
- effect(DEF cr);
-
- format %{ "addl $dst, $src\t# addExact int" %}
- ins_encode %{
- __ addl($dst$$Register, $src$$Register);
- %}
- ins_pipe(ialu_reg_reg);
-%}
-
-instruct addExactI_rReg_imm(rax_RegI dst, immI src, rFlagsReg cr)
-%{
- match(AddExactI dst src);
- effect(DEF cr);
-
- format %{ "addl $dst, $src\t# addExact int" %}
- ins_encode %{
- __ addl($dst$$Register, $src$$constant);
- %}
- ins_pipe(ialu_reg_reg);
-%}
-
-instruct addExactI_rReg_mem(rax_RegI dst, memory src, rFlagsReg cr)
-%{
- match(AddExactI dst (LoadI src));
- effect(DEF cr);
-
- ins_cost(125); // XXX
- format %{ "addl $dst, $src\t# addExact int" %}
- ins_encode %{
- __ addl($dst$$Register, $src$$Address);
- %}
-
- ins_pipe(ialu_reg_mem);
-%}
-
-instruct addExactL_rReg(rax_RegL dst, rRegL src, rFlagsReg cr)
-%{
- match(AddExactL dst src);
- effect(DEF cr);
-
- format %{ "addq $dst, $src\t# addExact long" %}
- ins_encode %{
- __ addq($dst$$Register, $src$$Register);
- %}
- ins_pipe(ialu_reg_reg);
-%}
-
-instruct addExactL_rReg_imm(rax_RegL dst, immL32 src, rFlagsReg cr)
-%{
- match(AddExactL dst src);
- effect(DEF cr);
-
- format %{ "addq $dst, $src\t# addExact long" %}
- ins_encode %{
- __ addq($dst$$Register, $src$$constant);
- %}
- ins_pipe(ialu_reg_reg);
-%}
-
-instruct addExactL_rReg_mem(rax_RegL dst, memory src, rFlagsReg cr)
-%{
- match(AddExactL dst (LoadL src));
- effect(DEF cr);
-
- ins_cost(125); // XXX
- format %{ "addq $dst, $src\t# addExact long" %}
- ins_encode %{
- __ addq($dst$$Register, $src$$Address);
- %}
-
- ins_pipe(ialu_reg_mem);
-%}
-
instruct addI_rReg(rRegI dst, rRegI src, rFlagsReg cr)
%{
match(Set dst (AddI dst src));
@@ -7416,80 +7328,6 @@ instruct subI_mem_imm(memory dst, immI src, rFlagsReg cr)
ins_pipe(ialu_mem_imm);
%}
-instruct subExactI_rReg(rax_RegI dst, rRegI src, rFlagsReg cr)
-%{
- match(SubExactI dst src);
- effect(DEF cr);
-
- format %{ "subl $dst, $src\t# subExact int" %}
- ins_encode %{
- __ subl($dst$$Register, $src$$Register);
- %}
- ins_pipe(ialu_reg_reg);
-%}
-
-instruct subExactI_rReg_imm(rax_RegI dst, immI src, rFlagsReg cr)
-%{
- match(SubExactI dst src);
- effect(DEF cr);
-
- format %{ "subl $dst, $src\t# subExact int" %}
- ins_encode %{
- __ subl($dst$$Register, $src$$constant);
- %}
- ins_pipe(ialu_reg_reg);
-%}
-
-instruct subExactI_rReg_mem(rax_RegI dst, memory src, rFlagsReg cr)
-%{
- match(SubExactI dst (LoadI src));
- effect(DEF cr);
-
- ins_cost(125);
- format %{ "subl $dst, $src\t# subExact int" %}
- ins_encode %{
- __ subl($dst$$Register, $src$$Address);
- %}
- ins_pipe(ialu_reg_mem);
-%}
-
-instruct subExactL_rReg(rax_RegL dst, rRegL src, rFlagsReg cr)
-%{
- match(SubExactL dst src);
- effect(DEF cr);
-
- format %{ "subq $dst, $src\t# subExact long" %}
- ins_encode %{
- __ subq($dst$$Register, $src$$Register);
- %}
- ins_pipe(ialu_reg_reg);
-%}
-
-instruct subExactL_rReg_imm(rax_RegL dst, immL32 src, rFlagsReg cr)
-%{
- match(SubExactL dst (LoadL src));
- effect(DEF cr);
-
- format %{ "subq $dst, $src\t# subExact long" %}
- ins_encode %{
- __ subq($dst$$Register, $src$$constant);
- %}
- ins_pipe(ialu_reg_reg);
-%}
-
-instruct subExactL_rReg_mem(rax_RegI dst, memory src, rFlagsReg cr)
-%{
- match(SubExactI dst src);
- effect(DEF cr);
-
- ins_cost(125);
- format %{ "subq $dst, $src\t# subExact long" %}
- ins_encode %{
- __ subq($dst$$Register, $src$$Address);
- %}
- ins_pipe(ialu_reg_mem);
-%}
-
instruct subL_rReg(rRegL dst, rRegL src, rFlagsReg cr)
%{
match(Set dst (SubL dst src));
@@ -7606,31 +7444,6 @@ instruct negL_mem(memory dst, immL0 zero, rFlagsReg cr)
ins_pipe(ialu_reg);
%}
-instruct negExactI_rReg(rax_RegI dst, rFlagsReg cr)
-%{
- match(NegExactI dst);
- effect(KILL cr);
-
- format %{ "negl $dst\t# negExact int" %}
- ins_encode %{
- __ negl($dst$$Register);
- %}
- ins_pipe(ialu_reg);
-%}
-
-instruct negExactL_rReg(rax_RegL dst, rFlagsReg cr)
-%{
- match(NegExactL dst);
- effect(KILL cr);
-
- format %{ "negq $dst\t# negExact long" %}
- ins_encode %{
- __ negq($dst$$Register);
- %}
- ins_pipe(ialu_reg);
-%}
-
-
//----------Multiplication/Division Instructions-------------------------------
// Integer Multiplication Instructions
// Multiply Register
@@ -7747,86 +7560,6 @@ instruct mulHiL_rReg(rdx_RegL dst, no_rax_RegL src, rax_RegL rax, rFlagsReg cr)
ins_pipe(ialu_reg_reg_alu0);
%}
-
-instruct mulExactI_rReg(rax_RegI dst, rRegI src, rFlagsReg cr)
-%{
- match(MulExactI dst src);
- effect(DEF cr);
-
- ins_cost(300);
- format %{ "imull $dst, $src\t# mulExact int" %}
- ins_encode %{
- __ imull($dst$$Register, $src$$Register);
- %}
- ins_pipe(ialu_reg_reg_alu0);
-%}
-
-
-instruct mulExactI_rReg_imm(rax_RegI dst, rRegI src, immI imm, rFlagsReg cr)
-%{
- match(MulExactI src imm);
- effect(DEF cr);
-
- ins_cost(300);
- format %{ "imull $dst, $src, $imm\t# mulExact int" %}
- ins_encode %{
- __ imull($dst$$Register, $src$$Register, $imm$$constant);
- %}
- ins_pipe(ialu_reg_reg_alu0);
-%}
-
-instruct mulExactI_rReg_mem(rax_RegI dst, memory src, rFlagsReg cr)
-%{
- match(MulExactI dst (LoadI src));
- effect(DEF cr);
-
- ins_cost(350);
- format %{ "imull $dst, $src\t# mulExact int" %}
- ins_encode %{
- __ imull($dst$$Register, $src$$Address);
- %}
- ins_pipe(ialu_reg_mem_alu0);
-%}
-
-instruct mulExactL_rReg(rax_RegL dst, rRegL src, rFlagsReg cr)
-%{
- match(MulExactL dst src);
- effect(DEF cr);
-
- ins_cost(300);
- format %{ "imulq $dst, $src\t# mulExact long" %}
- ins_encode %{
- __ imulq($dst$$Register, $src$$Register);
- %}
- ins_pipe(ialu_reg_reg_alu0);
-%}
-
-instruct mulExactL_rReg_imm(rax_RegL dst, rRegL src, immL32 imm, rFlagsReg cr)
-%{
- match(MulExactL src imm);
- effect(DEF cr);
-
- ins_cost(300);
- format %{ "imulq $dst, $src, $imm\t# mulExact long" %}
- ins_encode %{
- __ imulq($dst$$Register, $src$$Register, $imm$$constant);
- %}
- ins_pipe(ialu_reg_reg_alu0);
-%}
-
-instruct mulExactL_rReg_mem(rax_RegL dst, memory src, rFlagsReg cr)
-%{
- match(MulExactL dst (LoadL src));
- effect(DEF cr);
-
- ins_cost(350);
- format %{ "imulq $dst, $src\t# mulExact long" %}
- ins_encode %{
- __ imulq($dst$$Register, $src$$Address);
- %}
- ins_pipe(ialu_reg_mem_alu0);
-%}
-
instruct divI_rReg(rax_RegI rax, rdx_RegI rdx, no_rax_rdx_RegI div,
rFlagsReg cr)
%{
@@ -10435,6 +10168,174 @@ instruct encode_iso_array(rsi_RegP src, rdi_RegP dst, rdx_RegI len,
ins_pipe( pipe_slow );
%}
+//----------Overflow Math Instructions-----------------------------------------
+
+instruct overflowAddI_rReg(rFlagsReg cr, rax_RegI op1, rRegI op2)
+%{
+ match(Set cr (OverflowAddI op1 op2));
+ effect(DEF cr, USE_KILL op1, USE op2);
+
+ format %{ "addl $op1, $op2\t# overflow check int" %}
+
+ ins_encode %{
+ __ addl($op1$$Register, $op2$$Register);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowAddI_rReg_imm(rFlagsReg cr, rax_RegI op1, immI op2)
+%{
+ match(Set cr (OverflowAddI op1 op2));
+ effect(DEF cr, USE_KILL op1, USE op2);
+
+ format %{ "addl $op1, $op2\t# overflow check int" %}
+
+ ins_encode %{
+ __ addl($op1$$Register, $op2$$constant);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowAddL_rReg(rFlagsReg cr, rax_RegL op1, rRegL op2)
+%{
+ match(Set cr (OverflowAddL op1 op2));
+ effect(DEF cr, USE_KILL op1, USE op2);
+
+ format %{ "addq $op1, $op2\t# overflow check long" %}
+ ins_encode %{
+ __ addq($op1$$Register, $op2$$Register);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowAddL_rReg_imm(rFlagsReg cr, rax_RegL op1, immL32 op2)
+%{
+ match(Set cr (OverflowAddL op1 op2));
+ effect(DEF cr, USE_KILL op1, USE op2);
+
+ format %{ "addq $op1, $op2\t# overflow check long" %}
+ ins_encode %{
+ __ addq($op1$$Register, $op2$$constant);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowSubI_rReg(rFlagsReg cr, rRegI op1, rRegI op2)
+%{
+ match(Set cr (OverflowSubI op1 op2));
+
+ format %{ "cmpl $op1, $op2\t# overflow check int" %}
+ ins_encode %{
+ __ cmpl($op1$$Register, $op2$$Register);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowSubI_rReg_imm(rFlagsReg cr, rRegI op1, immI op2)
+%{
+ match(Set cr (OverflowSubI op1 op2));
+
+ format %{ "cmpl $op1, $op2\t# overflow check int" %}
+ ins_encode %{
+ __ cmpl($op1$$Register, $op2$$constant);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowSubL_rReg(rFlagsReg cr, rRegL op1, rRegL op2)
+%{
+ match(Set cr (OverflowSubL op1 op2));
+
+ format %{ "cmpq $op1, $op2\t# overflow check long" %}
+ ins_encode %{
+ __ cmpq($op1$$Register, $op2$$Register);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowSubL_rReg_imm(rFlagsReg cr, rRegL op1, immL32 op2)
+%{
+ match(Set cr (OverflowSubL op1 op2));
+
+ format %{ "cmpq $op1, $op2\t# overflow check long" %}
+ ins_encode %{
+ __ cmpq($op1$$Register, $op2$$constant);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowNegI_rReg(rFlagsReg cr, immI0 zero, rax_RegI op2)
+%{
+ match(Set cr (OverflowSubI zero op2));
+ effect(DEF cr, USE_KILL op2);
+
+ format %{ "negl $op2\t# overflow check int" %}
+ ins_encode %{
+ __ negl($op2$$Register);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowNegL_rReg(rFlagsReg cr, immL0 zero, rax_RegL op2)
+%{
+ match(Set cr (OverflowSubL zero op2));
+ effect(DEF cr, USE_KILL op2);
+
+ format %{ "negq $op2\t# overflow check long" %}
+ ins_encode %{
+ __ negq($op2$$Register);
+ %}
+ ins_pipe(ialu_reg_reg);
+%}
+
+instruct overflowMulI_rReg(rFlagsReg cr, rax_RegI op1, rRegI op2)
+%{
+ match(Set cr (OverflowMulI op1 op2));
+ effect(DEF cr, USE_KILL op1, USE op2);
+
+ format %{ "imull $op1, $op2\t# overflow check int" %}
+ ins_encode %{
+ __ imull($op1$$Register, $op2$$Register);
+ %}
+ ins_pipe(ialu_reg_reg_alu0);
+%}
+
+instruct overflowMulI_rReg_imm(rFlagsReg cr, rRegI op1, immI op2, rRegI tmp)
+%{
+ match(Set cr (OverflowMulI op1 op2));
+ effect(DEF cr, TEMP tmp, USE op1, USE op2);
+
+ format %{ "imull $tmp, $op1, $op2\t# overflow check int" %}
+ ins_encode %{
+ __ imull($tmp$$Register, $op1$$Register, $op2$$constant);
+ %}
+ ins_pipe(ialu_reg_reg_alu0);
+%}
+
+instruct overflowMulL_rReg(rFlagsReg cr, rax_RegL op1, rRegL op2)
+%{
+ match(Set cr (OverflowMulL op1 op2));
+ effect(DEF cr, USE_KILL op1, USE op2);
+
+ format %{ "imulq $op1, $op2\t# overflow check long" %}
+ ins_encode %{
+ __ imulq($op1$$Register, $op2$$Register);
+ %}
+ ins_pipe(ialu_reg_reg_alu0);
+%}
+
+instruct overflowMulL_rReg_imm(rFlagsReg cr, rRegL op1, immL32 op2, rRegL tmp)
+%{
+ match(Set cr (OverflowMulL op1 op2));
+ effect(DEF cr, TEMP tmp, USE op1, USE op2);
+
+ format %{ "imulq $tmp, $op1, $op2\t# overflow check long" %}
+ ins_encode %{
+ __ imulq($tmp$$Register, $op1$$Register, $op2$$constant);
+ %}
+ ins_pipe(ialu_reg_reg_alu0);
+%}
+
//----------Control Flow Instructions------------------------------------------
// Signed compare Instructions
diff --git a/src/share/vm/adlc/archDesc.cpp b/src/share/vm/adlc/archDesc.cpp
index 073954c9b..b24ce7478 100644
--- a/src/share/vm/adlc/archDesc.cpp
+++ b/src/share/vm/adlc/archDesc.cpp
@@ -1192,15 +1192,12 @@ void ArchDesc::buildMustCloneMap(FILE *fp_hpp, FILE *fp_cpp) {
|| strcmp(idealName,"CmpF") == 0
|| strcmp(idealName,"FastLock") == 0
|| strcmp(idealName,"FastUnlock") == 0
- || strcmp(idealName,"AddExactI") == 0
- || strcmp(idealName,"AddExactL") == 0
- || strcmp(idealName,"SubExactI") == 0
- || strcmp(idealName,"SubExactL") == 0
- || strcmp(idealName,"MulExactI") == 0
- || strcmp(idealName,"MulExactL") == 0
- || strcmp(idealName,"NegExactI") == 0
- || strcmp(idealName,"NegExactL") == 0
- || strcmp(idealName,"FlagsProj") == 0
+ || strcmp(idealName,"OverflowAddI") == 0
+ || strcmp(idealName,"OverflowAddL") == 0
+ || strcmp(idealName,"OverflowSubI") == 0
+ || strcmp(idealName,"OverflowSubL") == 0
+ || strcmp(idealName,"OverflowMulI") == 0
+ || strcmp(idealName,"OverflowMulL") == 0
|| strcmp(idealName,"Bool") == 0
|| strcmp(idealName,"Binary") == 0 ) {
// Removed ConI from the must_clone list. CPUs that cannot use
diff --git a/src/share/vm/opto/c2_globals.hpp b/src/share/vm/opto/c2_globals.hpp
index b3b2fd234..83e5fbbf6 100644
--- a/src/share/vm/opto/c2_globals.hpp
+++ b/src/share/vm/opto/c2_globals.hpp
@@ -637,7 +637,7 @@
diagnostic(bool, OptimizeExpensiveOps, true, \
"Find best control for expensive operations") \
\
- experimental(bool, UseMathExactIntrinsics, false, \
+ product(bool, UseMathExactIntrinsics, true, \
"Enables intrinsification of various java.lang.Math functions") \
\
experimental(bool, ReplaceInParentMaps, false, \
diff --git a/src/share/vm/opto/classes.hpp b/src/share/vm/opto/classes.hpp
index 7390c915d..cb5a2f8dd 100644
--- a/src/share/vm/opto/classes.hpp
+++ b/src/share/vm/opto/classes.hpp
@@ -29,8 +29,6 @@ macro(AbsD)
macro(AbsF)
macro(AbsI)
macro(AddD)
-macro(AddExactI)
-macro(AddExactL)
macro(AddF)
macro(AddI)
macro(AddL)
@@ -135,7 +133,6 @@ macro(EncodePKlass)
macro(ExpD)
macro(FastLock)
macro(FastUnlock)
-macro(FlagsProj)
macro(Goto)
macro(Halt)
macro(If)
@@ -170,9 +167,6 @@ macro(Loop)
macro(LoopLimit)
macro(Mach)
macro(MachProj)
-macro(MathExact)
-macro(MathExactI)
-macro(MathExactL)
macro(MaxI)
macro(MemBarAcquire)
macro(MemBarAcquireLock)
@@ -192,22 +186,24 @@ macro(MoveF2I)
macro(MoveL2D)
macro(MoveD2L)
macro(MulD)
-macro(MulExactI)
-macro(MulExactL)
macro(MulF)
macro(MulHiL)
macro(MulI)
macro(MulL)
macro(Multi)
macro(NegD)
-macro(NegExactI)
-macro(NegExactL)
macro(NegF)
macro(NeverBranch)
macro(Opaque1)
macro(Opaque2)
macro(OrI)
macro(OrL)
+macro(OverflowAddI)
+macro(OverflowSubI)
+macro(OverflowMulI)
+macro(OverflowAddL)
+macro(OverflowSubL)
+macro(OverflowMulL)
macro(PCTable)
macro(Parm)
macro(PartialSubtypeCheck)
@@ -251,8 +247,6 @@ macro(StrComp)
macro(StrEquals)
macro(StrIndexOf)
macro(SubD)
-macro(SubExactI)
-macro(SubExactL)
macro(SubF)
macro(SubI)
macro(SubL)
diff --git a/src/share/vm/opto/compile.cpp b/src/share/vm/opto/compile.cpp
index 10b62f336..8d587213c 100644
--- a/src/share/vm/opto/compile.cpp
+++ b/src/share/vm/opto/compile.cpp
@@ -3012,42 +3012,6 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) {
n->set_req(MemBarNode::Precedent, top());
}
break;
- // Must set a control edge on all nodes that produce a FlagsProj
- // so they can't escape the block that consumes the flags.
- // Must also set the non throwing branch as the control
- // for all nodes that depends on the result. Unless the node
- // already have a control that isn't the control of the
- // flag producer
- case Op_FlagsProj:
- {
- MathExactNode* math = (MathExactNode*) n->in(0);
- Node* ctrl = math->control_node();
- Node* non_throwing = math->non_throwing_branch();
- math->set_req(0, ctrl);
-
- Node* result = math->result_node();
- if (result != NULL) {
- for (DUIterator_Fast jmax, j = result->fast_outs(jmax); j < jmax; j++) {
- Node* out = result->fast_out(j);
- // Phi nodes shouldn't be moved. They would only match below if they
- // had the same control as the MathExactNode. The only time that
- // would happen is if the Phi is also an input to the MathExact
- //
- // Cmp nodes shouldn't have control set at all.
- if (out->is_Phi() ||
- out->is_Cmp()) {
- continue;
- }
-
- if (out->in(0) == NULL) {
- out->set_req(0, non_throwing);
- } else if (out->in(0) == ctrl) {
- out->set_req(0, non_throwing);
- }
- }
- }
- }
- break;
default:
assert( !n->is_Call(), "" );
assert( !n->is_Mem(), "" );
diff --git a/src/share/vm/opto/ifnode.cpp b/src/share/vm/opto/ifnode.cpp
index 6e61a1f98..1c9dbb708 100644
--- a/src/share/vm/opto/ifnode.cpp
+++ b/src/share/vm/opto/ifnode.cpp
@@ -76,7 +76,6 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) {
if( !i1->is_Bool() ) return NULL;
BoolNode *b = i1->as_Bool();
Node *cmp = b->in(1);
- if( cmp->is_FlagsProj() ) return NULL;
if( !cmp->is_Cmp() ) return NULL;
i1 = cmp->in(1);
if( i1 == NULL || !i1->is_Phi() ) return NULL;
diff --git a/src/share/vm/opto/lcm.cpp b/src/share/vm/opto/lcm.cpp
index bdf076aa3..44614cb4c 100644
--- a/src/share/vm/opto/lcm.cpp
+++ b/src/share/vm/opto/lcm.cpp
@@ -472,13 +472,6 @@ Node* PhaseCFG::select(Block* block, Node_List &worklist, GrowableArray<int> &re
break;
}
- // For nodes that produce a FlagsProj, make the node adjacent to the
- // use of the FlagsProj
- if (use->is_FlagsProj() && get_block_for_node(use) == block) {
- found_machif = true;
- break;
- }
-
// More than this instruction pending for successor to be ready,
// don't choose this if other opportunities are ready
if (ready_cnt.at(use->_idx) > 1)
diff --git a/src/share/vm/opto/library_call.cpp b/src/share/vm/opto/library_call.cpp
index 1630c6881..3a54074c0 100644
--- a/src/share/vm/opto/library_call.cpp
+++ b/src/share/vm/opto/library_call.cpp
@@ -203,7 +203,9 @@ class LibraryCallKit : public GraphKit {
bool inline_math_native(vmIntrinsics::ID id);
bool inline_trig(vmIntrinsics::ID id);
bool inline_math(vmIntrinsics::ID id);
- void inline_math_mathExact(Node* math);
+ template <typename OverflowOp>
+ bool inline_math_overflow(Node* arg1, Node* arg2);
+ void inline_math_mathExact(Node* math, Node* test);
bool inline_math_addExactI(bool is_increment);
bool inline_math_addExactL(bool is_increment);
bool inline_math_multiplyExactI();
@@ -517,31 +519,31 @@ CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) {
case vmIntrinsics::_incrementExactI:
case vmIntrinsics::_addExactI:
- if (!Matcher::match_rule_supported(Op_AddExactI) || !UseMathExactIntrinsics) return NULL;
+ if (!Matcher::match_rule_supported(Op_OverflowAddI) || !UseMathExactIntrinsics) return NULL;
break;
case vmIntrinsics::_incrementExactL:
case vmIntrinsics::_addExactL:
- if (!Matcher::match_rule_supported(Op_AddExactL) || !UseMathExactIntrinsics) return NULL;
+ if (!Matcher::match_rule_supported(Op_OverflowAddL) || !UseMathExactIntrinsics) return NULL;
break;
case vmIntrinsics::_decrementExactI:
case vmIntrinsics::_subtractExactI:
- if (!Matcher::match_rule_supported(Op_SubExactI) || !UseMathExactIntrinsics) return NULL;
+ if (!Matcher::match_rule_supported(Op_OverflowSubI) || !UseMathExactIntrinsics) return NULL;
break;
case vmIntrinsics::_decrementExactL:
case vmIntrinsics::_subtractExactL:
- if (!Matcher::match_rule_supported(Op_SubExactL) || !UseMathExactIntrinsics) return NULL;
+ if (!Matcher::match_rule_supported(Op_OverflowSubL) || !UseMathExactIntrinsics) return NULL;
break;
case vmIntrinsics::_negateExactI:
- if (!Matcher::match_rule_supported(Op_NegExactI) || !UseMathExactIntrinsics) return NULL;
+ if (!Matcher::match_rule_supported(Op_OverflowSubI) || !UseMathExactIntrinsics) return NULL;
break;
case vmIntrinsics::_negateExactL:
- if (!Matcher::match_rule_supported(Op_NegExactL) || !UseMathExactIntrinsics) return NULL;
+ if (!Matcher::match_rule_supported(Op_OverflowSubL) || !UseMathExactIntrinsics) return NULL;
break;
case vmIntrinsics::_multiplyExactI:
- if (!Matcher::match_rule_supported(Op_MulExactI) || !UseMathExactIntrinsics) return NULL;
+ if (!Matcher::match_rule_supported(Op_OverflowMulI) || !UseMathExactIntrinsics) return NULL;
break;
case vmIntrinsics::_multiplyExactL:
- if (!Matcher::match_rule_supported(Op_MulExactL) || !UseMathExactIntrinsics) return NULL;
+ if (!Matcher::match_rule_supported(Op_OverflowMulL) || !UseMathExactIntrinsics) return NULL;
break;
default:
@@ -1970,18 +1972,8 @@ bool LibraryCallKit::inline_min_max(vmIntrinsics::ID id) {
return true;
}
-void LibraryCallKit::inline_math_mathExact(Node* math) {
- // If we didn't get the expected opcode it means we have optimized
- // the node to something else and don't need the exception edge.
- if (!math->is_MathExact()) {
- set_result(math);
- return;
- }
-
- Node* result = _gvn.transform( new(C) ProjNode(math, MathExactNode::result_proj_node));
- Node* flags = _gvn.transform( new(C) FlagsProjNode(math, MathExactNode::flags_proj_node));
-
- Node* bol = _gvn.transform( new (C) BoolNode(flags, BoolTest::overflow) );
+void LibraryCallKit::inline_math_mathExact(Node* math, Node *test) {
+ Node* bol = _gvn.transform( new (C) BoolNode(test, BoolTest::overflow) );
IfNode* check = create_and_map_if(control(), bol, PROB_UNLIKELY_MAG(3), COUNT_UNKNOWN);
Node* fast_path = _gvn.transform( new (C) IfFalseNode(check));
Node* slow_path = _gvn.transform( new (C) IfTrueNode(check) );
@@ -1999,108 +1991,50 @@ void LibraryCallKit::inline_math_mathExact(Node* math) {
}
set_control(fast_path);
- set_result(result);
+ set_result(math);
}
-bool LibraryCallKit::inline_math_addExactI(bool is_increment) {
- Node* arg1 = argument(0);
- Node* arg2 = NULL;
+template <typename OverflowOp>
+bool LibraryCallKit::inline_math_overflow(Node* arg1, Node* arg2) {
+ typedef typename OverflowOp::MathOp MathOp;
- if (is_increment) {
- arg2 = intcon(1);
- } else {
- arg2 = argument(1);
- }
-
- Node* add = _gvn.transform( new(C) AddExactINode(NULL, arg1, arg2) );
- inline_math_mathExact(add);
+ MathOp* mathOp = new(C) MathOp(arg1, arg2);
+ Node* operation = _gvn.transform( mathOp );
+ Node* ofcheck = _gvn.transform( new(C) OverflowOp(arg1, arg2) );
+ inline_math_mathExact(operation, ofcheck);
return true;
}
-bool LibraryCallKit::inline_math_addExactL(bool is_increment) {
- Node* arg1 = argument(0); // type long
- // argument(1) == TOP
- Node* arg2 = NULL;
-
- if (is_increment) {
- arg2 = longcon(1);
- } else {
- arg2 = argument(2); // type long
- // argument(3) == TOP
- }
+bool LibraryCallKit::inline_math_addExactI(bool is_increment) {
+ return inline_math_overflow<OverflowAddINode>(argument(0), is_increment ? intcon(1) : argument(1));
+}
- Node* add = _gvn.transform(new(C) AddExactLNode(NULL, arg1, arg2));
- inline_math_mathExact(add);
- return true;
+bool LibraryCallKit::inline_math_addExactL(bool is_increment) {
+ return inline_math_overflow<OverflowAddLNode>(argument(0), is_increment ? longcon(1) : argument(2));
}
bool LibraryCallKit::inline_math_subtractExactI(bool is_decrement) {
- Node* arg1 = argument(0);
- Node* arg2 = NULL;
-
- if (is_decrement) {
- arg2 = intcon(1);
- } else {
- arg2 = argument(1);
- }
-
- Node* sub = _gvn.transform(new(C) SubExactINode(NULL, arg1, arg2));
- inline_math_mathExact(sub);
- return true;
+ return inline_math_overflow<OverflowSubINode>(argument(0), is_decrement ? intcon(1) : argument(1));
}
bool LibraryCallKit::inline_math_subtractExactL(bool is_decrement) {
- Node* arg1 = argument(0); // type long
- // argument(1) == TOP
- Node* arg2 = NULL;
-
- if (is_decrement) {
- arg2 = longcon(1);
- } else {
- arg2 = argument(2); // type long
- // argument(3) == TOP
- }
-
- Node* sub = _gvn.transform(new(C) SubExactLNode(NULL, arg1, arg2));
- inline_math_mathExact(sub);
- return true;
+ return inline_math_overflow<OverflowSubLNode>(argument(0), is_decrement ? longcon(1) : argument(2));
}
bool LibraryCallKit::inline_math_negateExactI() {
- Node* arg1 = argument(0);
-
- Node* neg = _gvn.transform(new(C) NegExactINode(NULL, arg1));
- inline_math_mathExact(neg);
- return true;
+ return inline_math_overflow<OverflowSubINode>(intcon(0), argument(0));
}
bool LibraryCallKit::inline_math_negateExactL() {
- Node* arg1 = argument(0);
- // argument(1) == TOP
-
- Node* neg = _gvn.transform(new(C) NegExactLNode(NULL, arg1));
- inline_math_mathExact(neg);
- return true;
+ return inline_math_overflow<OverflowSubLNode>(longcon(0), argument(0));
}
bool LibraryCallKit::inline_math_multiplyExactI() {
- Node* arg1 = argument(0);
- Node* arg2 = argument(1);
-
- Node* mul = _gvn.transform(new(C) MulExactINode(NULL, arg1, arg2));
- inline_math_mathExact(mul);
- return true;
+ return inline_math_overflow<OverflowMulINode>(argument(0), argument(1));
}
bool LibraryCallKit::inline_math_multiplyExactL() {
- Node* arg1 = argument(0);
- // argument(1) == TOP
- Node* arg2 = argument(2);
- // argument(3) == TOP
-
- Node* mul = _gvn.transform(new(C) MulExactLNode(NULL, arg1, arg2));
- inline_math_mathExact(mul);
- return true;
+ return inline_math_overflow<OverflowMulLNode>(argument(0), argument(2));
}
Node*
diff --git a/src/share/vm/opto/loopTransform.cpp b/src/share/vm/opto/loopTransform.cpp
index af31a9ce1..6b2196ec8 100644
--- a/src/share/vm/opto/loopTransform.cpp
+++ b/src/share/vm/opto/loopTransform.cpp
@@ -713,10 +713,6 @@ bool IdealLoopTree::policy_unroll( PhaseIdealLoop *phase ) const {
case Op_ModL: body_size += 30; break;
case Op_DivL: body_size += 30; break;
case Op_MulL: body_size += 10; break;
- case Op_FlagsProj:
- // Can't handle unrolling of loops containing
- // nodes that generate a FlagsProj at the moment
- return false;
case Op_StrComp:
case Op_StrEquals:
case Op_StrIndexOf:
@@ -780,10 +776,6 @@ bool IdealLoopTree::policy_range_check( PhaseIdealLoop *phase ) const {
continue; // not RC
Node *cmp = bol->in(1);
- if (cmp->is_FlagsProj()) {
- continue;
- }
-
Node *rc_exp = cmp->in(1);
Node *limit = cmp->in(2);
diff --git a/src/share/vm/opto/loopopts.cpp b/src/share/vm/opto/loopopts.cpp
index ac97d3ede..f9a87bbac 100644
--- a/src/share/vm/opto/loopopts.cpp
+++ b/src/share/vm/opto/loopopts.cpp
@@ -43,12 +43,6 @@ Node *PhaseIdealLoop::split_thru_phi( Node *n, Node *region, int policy ) {
return NULL;
}
- if (n->is_MathExact()) {
- // MathExact has projections that are not correctly handled in the code
- // below.
- return NULL;
- }
-
int wins = 0;
assert(!n->is_CFG(), "");
assert(region->is_Region(), "");
@@ -2362,8 +2356,7 @@ bool PhaseIdealLoop::partial_peel( IdealLoopTree *loop, Node_List &old_new ) {
opc == Op_Catch ||
opc == Op_CatchProj ||
opc == Op_Jump ||
- opc == Op_JumpProj ||
- opc == Op_FlagsProj) {
+ opc == Op_JumpProj) {
#if !defined(PRODUCT)
if (TracePartialPeeling) {
tty->print_cr("\nExit control too complex: lp: %d", head->_idx);
diff --git a/src/share/vm/opto/matcher.cpp b/src/share/vm/opto/matcher.cpp
index 25a710020..5088deb7c 100644
--- a/src/share/vm/opto/matcher.cpp
+++ b/src/share/vm/opto/matcher.cpp
@@ -1984,7 +1984,6 @@ void Matcher::find_shared( Node *n ) {
case Op_Catch:
case Op_CatchProj:
case Op_CProj:
- case Op_FlagsProj:
case Op_JumpProj:
case Op_JProj:
case Op_NeverBranch:
diff --git a/src/share/vm/opto/matcher.hpp b/src/share/vm/opto/matcher.hpp
index c29971709..5ebf59068 100644
--- a/src/share/vm/opto/matcher.hpp
+++ b/src/share/vm/opto/matcher.hpp
@@ -340,10 +340,6 @@ public:
// Register for MODL projection of divmodL
static RegMask modL_proj_mask();
- static const RegMask mathExactI_result_proj_mask();
- static const RegMask mathExactL_result_proj_mask();
- static const RegMask mathExactI_flags_proj_mask();
-
// Use hardware DIV instruction when it is faster than
// a code which use multiply for division by constant.
static bool use_asm_for_ldiv_by_con( jlong divisor );
diff --git a/src/share/vm/opto/mathexactnode.cpp b/src/share/vm/opto/mathexactnode.cpp
index bb930b37d..00466ad3d 100644
--- a/src/share/vm/opto/mathexactnode.cpp
+++ b/src/share/vm/opto/mathexactnode.cpp
@@ -31,400 +31,227 @@
#include "opto/mathexactnode.hpp"
#include "opto/subnode.hpp"
-MathExactNode::MathExactNode(Node* ctrl, Node* in1) : MultiNode(2) {
- init_class_id(Class_MathExact);
- init_req(0, ctrl);
- init_req(1, in1);
-}
-
-MathExactNode::MathExactNode(Node* ctrl, Node* in1, Node* in2) : MultiNode(3) {
- init_class_id(Class_MathExact);
- init_req(0, ctrl);
- init_req(1, in1);
- init_req(2, in2);
-}
-
-BoolNode* MathExactNode::bool_node() const {
- Node* flags = flags_node();
- BoolNode* boolnode = flags->unique_out()->as_Bool();
- assert(boolnode != NULL, "must have BoolNode");
- return boolnode;
-}
-
-IfNode* MathExactNode::if_node() const {
- BoolNode* boolnode = bool_node();
- IfNode* ifnode = boolnode->unique_out()->as_If();
- assert(ifnode != NULL, "must have IfNode");
- return ifnode;
-}
-
-Node* MathExactNode::control_node() const {
- IfNode* ifnode = if_node();
- return ifnode->in(0);
-}
-
-Node* MathExactNode::non_throwing_branch() const {
- IfNode* ifnode = if_node();
- if (bool_node()->_test._test == BoolTest::overflow) {
- return ifnode->proj_out(0);
- }
- return ifnode->proj_out(1);
-}
-
-// If the MathExactNode won't overflow we have to replace the
-// FlagsProjNode and ProjNode that is generated by the MathExactNode
-Node* MathExactNode::no_overflow(PhaseGVN* phase, Node* new_result) {
- PhaseIterGVN* igvn = phase->is_IterGVN();
- if (igvn) {
- ProjNode* result = result_node();
- ProjNode* flags = flags_node();
-
- if (result != NULL) {
- igvn->replace_node(result, new_result);
- }
-
- if (flags != NULL) {
- BoolNode* boolnode = bool_node();
- switch (boolnode->_test._test) {
- case BoolTest::overflow:
- // if the check is for overflow - never taken
- igvn->replace_node(boolnode, phase->intcon(0));
- break;
- case BoolTest::no_overflow:
- // if the check is for no overflow - always taken
- igvn->replace_node(boolnode, phase->intcon(1));
- break;
- default:
- fatal("Unexpected value of BoolTest");
- break;
- }
- flags->del_req(0);
- }
- }
- return new_result;
-}
-
-Node* MathExactINode::match(const ProjNode* proj, const Matcher* m) {
- uint ideal_reg = proj->ideal_reg();
- RegMask rm;
- if (proj->_con == result_proj_node) {
- rm = m->mathExactI_result_proj_mask();
- } else {
- assert(proj->_con == flags_proj_node, "must be result or flags");
- assert(ideal_reg == Op_RegFlags, "sanity");
- rm = m->mathExactI_flags_proj_mask();
- }
- return new (m->C) MachProjNode(this, proj->_con, rm, ideal_reg);
-}
-
-Node* MathExactLNode::match(const ProjNode* proj, const Matcher* m) {
- uint ideal_reg = proj->ideal_reg();
- RegMask rm;
- if (proj->_con == result_proj_node) {
- rm = m->mathExactL_result_proj_mask();
- } else {
- assert(proj->_con == flags_proj_node, "must be result or flags");
- assert(ideal_reg == Op_RegFlags, "sanity");
- rm = m->mathExactI_flags_proj_mask();
- }
- return new (m->C) MachProjNode(this, proj->_con, rm, ideal_reg);
-}
-
-Node* AddExactINode::Ideal(PhaseGVN* phase, bool can_reshape) {
- Node* arg1 = in(1);
- Node* arg2 = in(2);
-
- const Type* type1 = phase->type(arg1);
- const Type* type2 = phase->type(arg2);
-
- if (type1 != Type::TOP && type1->singleton() &&
- type2 != Type::TOP && type2->singleton()) {
- jint val1 = arg1->get_int();
- jint val2 = arg2->get_int();
- jint result = val1 + val2;
+template <typename OverflowOp>
+class AddHelper {
+public:
+ typedef typename OverflowOp::TypeClass TypeClass;
+ typedef typename TypeClass::NativeType NativeType;
+
+ static bool will_overflow(NativeType value1, NativeType value2) {
+ NativeType result = value1 + value2;
// Hacker's Delight 2-12 Overflow if both arguments have the opposite sign of the result
- if ( (((val1 ^ result) & (val2 ^ result)) >= 0)) {
- Node* con_result = ConINode::make(phase->C, result);
- return no_overflow(phase, con_result);
+ if (((value1 ^ result) & (value2 ^ result)) >= 0) {
+ return false;
}
- return NULL;
+ return true;
}
- if (type1 == TypeInt::ZERO || type2 == TypeInt::ZERO) { // (Add 0 x) == x
- Node* add_result = new (phase->C) AddINode(arg1, arg2);
- return no_overflow(phase, add_result);
+ static bool can_overflow(const Type* type1, const Type* type2) {
+ if (type1 == TypeClass::ZERO || type2 == TypeClass::ZERO) {
+ return false;
+ }
+ return true;
}
+};
- if (type2->singleton()) {
- return NULL; // no change - keep constant on the right
- }
+template <typename OverflowOp>
+class SubHelper {
+public:
+ typedef typename OverflowOp::TypeClass TypeClass;
+ typedef typename TypeClass::NativeType NativeType;
- if (type1->singleton()) {
- // Make it x + Constant - move constant to the right
- swap_edges(1, 2);
- return this;
+ static bool will_overflow(NativeType value1, NativeType value2) {
+ NativeType result = value1 - value2;
+ // hacker's delight 2-12 overflow iff the arguments have different signs and
+ // the sign of the result is different than the sign of arg1
+ if (((value1 ^ value2) & (value1 ^ result)) >= 0) {
+ return false;
+ }
+ return true;
}
- if (arg2->is_Load()) {
- return NULL; // no change - keep load on the right
+ static bool can_overflow(const Type* type1, const Type* type2) {
+ if (type2 == TypeClass::ZERO) {
+ return false;
+ }
+ return true;
}
+};
- if (arg1->is_Load()) {
- // Make it x + Load - move load to the right
- swap_edges(1, 2);
- return this;
- }
+template <typename OverflowOp>
+class MulHelper {
+public:
+ typedef typename OverflowOp::TypeClass TypeClass;
- if (arg1->_idx > arg2->_idx) {
- // Sort the edges
- swap_edges(1, 2);
- return this;
+ static bool can_overflow(const Type* type1, const Type* type2) {
+ if (type1 == TypeClass::ZERO || type2 == TypeClass::ZERO) {
+ return false;
+ } else if (type1 == TypeClass::ONE || type2 == TypeClass::ONE) {
+ return false;
+ }
+ return true;
}
+};
- return NULL;
+bool OverflowAddINode::will_overflow(jint v1, jint v2) const {
+ return AddHelper<OverflowAddINode>::will_overflow(v1, v2);
}
-Node* AddExactLNode::Ideal(PhaseGVN* phase, bool can_reshape) {
- Node* arg1 = in(1);
- Node* arg2 = in(2);
-
- const Type* type1 = phase->type(arg1);
- const Type* type2 = phase->type(arg2);
+bool OverflowSubINode::will_overflow(jint v1, jint v2) const {
+ return SubHelper<OverflowSubINode>::will_overflow(v1, v2);
+}
- if (type1 != Type::TOP && type1->singleton() &&
- type2 != Type::TOP && type2->singleton()) {
- jlong val1 = arg1->get_long();
- jlong val2 = arg2->get_long();
- jlong result = val1 + val2;
- // Hacker's Delight 2-12 Overflow if both arguments have the opposite sign of the result
- if ( (((val1 ^ result) & (val2 ^ result)) >= 0)) {
- Node* con_result = ConLNode::make(phase->C, result);
- return no_overflow(phase, con_result);
+bool OverflowMulINode::will_overflow(jint v1, jint v2) const {
+ jlong result = (jlong) v1 * (jlong) v2;
+ if ((jint) result == result) {
+ return false;
}
- return NULL;
- }
-
- if (type1 == TypeLong::ZERO || type2 == TypeLong::ZERO) { // (Add 0 x) == x
- Node* add_result = new (phase->C) AddLNode(arg1, arg2);
- return no_overflow(phase, add_result);
- }
-
- if (type2->singleton()) {
- return NULL; // no change - keep constant on the right
- }
-
- if (type1->singleton()) {
- // Make it x + Constant - move constant to the right
- swap_edges(1, 2);
- return this;
- }
-
- if (arg2->is_Load()) {
- return NULL; // no change - keep load on the right
- }
-
- if (arg1->is_Load()) {
- // Make it x + Load - move load to the right
- swap_edges(1, 2);
- return this;
- }
-
- if (arg1->_idx > arg2->_idx) {
- // Sort the edges
- swap_edges(1, 2);
- return this;
- }
-
- return NULL;
+ return true;
}
-Node* SubExactINode::Ideal(PhaseGVN* phase, bool can_reshape) {
- Node* arg1 = in(1);
- Node* arg2 = in(2);
+bool OverflowAddLNode::will_overflow(jlong v1, jlong v2) const {
+ return AddHelper<OverflowAddLNode>::will_overflow(v1, v2);
+}
- const Type* type1 = phase->type(arg1);
- const Type* type2 = phase->type(arg2);
+bool OverflowSubLNode::will_overflow(jlong v1, jlong v2) const {
+ return SubHelper<OverflowSubLNode>::will_overflow(v1, v2);
+}
- if (type1 != Type::TOP && type1->singleton() &&
- type2 != Type::TOP && type2->singleton()) {
- jint val1 = arg1->get_int();
- jint val2 = arg2->get_int();
- jint result = val1 - val2;
+bool OverflowMulLNode::will_overflow(jlong val1, jlong val2) const {
+ jlong result = val1 * val2;
+ jlong ax = (val1 < 0 ? -val1 : val1);
+ jlong ay = (val2 < 0 ? -val2 : val2);
- // Hacker's Delight 2-12 Overflow iff the arguments have different signs and
- // the sign of the result is different than the sign of arg1
- if (((val1 ^ val2) & (val1 ^ result)) >= 0) {
- Node* con_result = ConINode::make(phase->C, result);
- return no_overflow(phase, con_result);
+ bool overflow = false;
+ if ((ax | ay) & CONST64(0xFFFFFFFF00000000)) {
+ // potential overflow if any bit in upper 32 bits are set
+ if ((val1 == min_jlong && val2 == -1) || (val2 == min_jlong && val1 == -1)) {
+ // -1 * Long.MIN_VALUE will overflow
+ overflow = true;
+ } else if (val2 != 0 && (result / val2 != val1)) {
+ overflow = true;
+ }
}
- return NULL;
- }
-
- if (type1 == TypeInt::ZERO || type2 == TypeInt::ZERO) {
- // Sub with zero is the same as add with zero
- Node* add_result = new (phase->C) AddINode(arg1, arg2);
- return no_overflow(phase, add_result);
- }
- return NULL;
+ return overflow;
}
-Node* SubExactLNode::Ideal(PhaseGVN* phase, bool can_reshape) {
- Node* arg1 = in(1);
- Node* arg2 = in(2);
-
- const Type* type1 = phase->type(arg1);
- const Type* type2 = phase->type(arg2);
-
- if (type1 != Type::TOP && type1->singleton() &&
- type2 != Type::TOP && type2->singleton()) {
- jlong val1 = arg1->get_long();
- jlong val2 = arg2->get_long();
- jlong result = val1 - val2;
-
- // Hacker's Delight 2-12 Overflow iff the arguments have different signs and
- // the sign of the result is different than the sign of arg1
- if (((val1 ^ val2) & (val1 ^ result)) >= 0) {
- Node* con_result = ConLNode::make(phase->C, result);
- return no_overflow(phase, con_result);
- }
- return NULL;
- }
+bool OverflowAddINode::can_overflow(const Type* t1, const Type* t2) const {
+ return AddHelper<OverflowAddINode>::can_overflow(t1, t2);
+}
- if (type1 == TypeLong::ZERO || type2 == TypeLong::ZERO) {
- // Sub with zero is the same as add with zero
- Node* add_result = new (phase->C) AddLNode(arg1, arg2);
- return no_overflow(phase, add_result);
+bool OverflowSubINode::can_overflow(const Type* t1, const Type* t2) const {
+ if (in(1) == in(2)) {
+ return false;
}
+ return SubHelper<OverflowSubINode>::can_overflow(t1, t2);
+}
- return NULL;
+bool OverflowMulINode::can_overflow(const Type* t1, const Type* t2) const {
+ return MulHelper<OverflowMulINode>::can_overflow(t1, t2);
}
-Node* NegExactINode::Ideal(PhaseGVN* phase, bool can_reshape) {
- Node *arg = in(1);
+bool OverflowAddLNode::can_overflow(const Type* t1, const Type* t2) const {
+ return AddHelper<OverflowAddLNode>::can_overflow(t1, t2);
+}
- const Type* type = phase->type(arg);
- if (type != Type::TOP && type->singleton()) {
- jint value = arg->get_int();
- if (value != min_jint) {
- Node* neg_result = ConINode::make(phase->C, -value);
- return no_overflow(phase, neg_result);
- }
+bool OverflowSubLNode::can_overflow(const Type* t1, const Type* t2) const {
+ if (in(1) == in(2)) {
+ return false;
}
- return NULL;
+ return SubHelper<OverflowSubLNode>::can_overflow(t1, t2);
}
-Node* NegExactLNode::Ideal(PhaseGVN* phase, bool can_reshape) {
- Node *arg = in(1);
+bool OverflowMulLNode::can_overflow(const Type* t1, const Type* t2) const {
+ return MulHelper<OverflowMulLNode>::can_overflow(t1, t2);
+}
- const Type* type = phase->type(arg);
- if (type != Type::TOP && type->singleton()) {
- jlong value = arg->get_long();
- if (value != min_jlong) {
- Node* neg_result = ConLNode::make(phase->C, -value);
- return no_overflow(phase, neg_result);
- }
- }
- return NULL;
+const Type* OverflowNode::sub(const Type* t1, const Type* t2) const {
+ fatal(err_msg_res("sub() should not be called for '%s'", NodeClassNames[this->Opcode()]));
+ return TypeInt::CC;
}
-Node* MulExactINode::Ideal(PhaseGVN* phase, bool can_reshape) {
- Node* arg1 = in(1);
- Node* arg2 = in(2);
+template <typename OverflowOp>
+struct IdealHelper {
+ typedef typename OverflowOp::TypeClass TypeClass; // TypeInt, TypeLong
+ typedef typename TypeClass::NativeType NativeType;
- const Type* type1 = phase->type(arg1);
- const Type* type2 = phase->type(arg2);
+ static Node* Ideal(const OverflowOp* node, PhaseGVN* phase, bool can_reshape) {
+ Node* arg1 = node->in(1);
+ Node* arg2 = node->in(2);
+ const Type* type1 = phase->type(arg1);
+ const Type* type2 = phase->type(arg2);
- if (type1 != Type::TOP && type1->singleton() &&
- type2 != Type::TOP && type2->singleton()) {
- jint val1 = arg1->get_int();
- jint val2 = arg2->get_int();
- jlong result = (jlong) val1 * (jlong) val2;
- if ((jint) result == result) {
- // no overflow
- Node* mul_result = ConINode::make(phase->C, result);
- return no_overflow(phase, mul_result);
+ if (type1 == NULL || type2 == NULL) {
+ return NULL;
}
- }
- if (type1 == TypeInt::ZERO || type2 == TypeInt::ZERO) {
- return no_overflow(phase, ConINode::make(phase->C, 0));
- }
-
- if (type1 == TypeInt::ONE) {
- Node* mul_result = new (phase->C) AddINode(arg2, phase->intcon(0));
- return no_overflow(phase, mul_result);
- }
- if (type2 == TypeInt::ONE) {
- Node* mul_result = new (phase->C) AddINode(arg1, phase->intcon(0));
- return no_overflow(phase, mul_result);
- }
-
- if (type1 == TypeInt::MINUS_1) {
- return new (phase->C) NegExactINode(NULL, arg2);
- }
-
- if (type2 == TypeInt::MINUS_1) {
- return new (phase->C) NegExactINode(NULL, arg1);
+ if (type1 != Type::TOP && type1->singleton() &&
+ type2 != Type::TOP && type2->singleton()) {
+ NativeType val1 = TypeClass::as_self(type1)->get_con();
+ NativeType val2 = TypeClass::as_self(type2)->get_con();
+ if (node->will_overflow(val1, val2) == false) {
+ Node* con_result = ConINode::make(phase->C, 0);
+ return con_result;
+ }
+ return NULL;
+ }
+ return NULL;
}
- return NULL;
-}
-
-Node* MulExactLNode::Ideal(PhaseGVN* phase, bool can_reshape) {
- Node* arg1 = in(1);
- Node* arg2 = in(2);
+ static const Type* Value(const OverflowOp* node, PhaseTransform* phase) {
+ const Type *t1 = phase->type( node->in(1) );
+ const Type *t2 = phase->type( node->in(2) );
+ if( t1 == Type::TOP ) return Type::TOP;
+ if( t2 == Type::TOP ) return Type::TOP;
- const Type* type1 = phase->type(arg1);
- const Type* type2 = phase->type(arg2);
+ const TypeClass* i1 = TypeClass::as_self(t1);
+ const TypeClass* i2 = TypeClass::as_self(t2);
- if (type1 != Type::TOP && type1->singleton() &&
- type2 != Type::TOP && type2->singleton()) {
- jlong val1 = arg1->get_long();
- jlong val2 = arg2->get_long();
-
- jlong result = val1 * val2;
- jlong ax = (val1 < 0 ? -val1 : val1);
- jlong ay = (val2 < 0 ? -val2 : val2);
+ if (i1 == NULL || i2 == NULL) {
+ return TypeInt::CC;
+ }
- bool overflow = false;
- if ((ax | ay) & CONST64(0xFFFFFFFF00000000)) {
- // potential overflow if any bit in upper 32 bits are set
- if ((val1 == min_jlong && val2 == -1) || (val2 == min_jlong && val1 == -1)) {
- // -1 * Long.MIN_VALUE will overflow
- overflow = true;
- } else if (val2 != 0 && (result / val2 != val1)) {
- overflow = true;
+ if (t1->singleton() && t2->singleton()) {
+ NativeType val1 = i1->get_con();
+ NativeType val2 = i2->get_con();
+ if (node->will_overflow(val1, val2)) {
+ return TypeInt::CC;
+ }
+ return TypeInt::ZERO;
+ } else if (i1 != TypeClass::TYPE_DOMAIN && i2 != TypeClass::TYPE_DOMAIN) {
+ if (node->will_overflow(i1->_lo, i2->_lo)) {
+ return TypeInt::CC;
+ } else if (node->will_overflow(i1->_lo, i2->_hi)) {
+ return TypeInt::CC;
+ } else if (node->will_overflow(i1->_hi, i2->_lo)) {
+ return TypeInt::CC;
+ } else if (node->will_overflow(i1->_hi, i2->_hi)) {
+ return TypeInt::CC;
}
+ return TypeInt::ZERO;
}
- if (!overflow) {
- Node* mul_result = ConLNode::make(phase->C, result);
- return no_overflow(phase, mul_result);
+ if (!node->can_overflow(t1, t2)) {
+ return TypeInt::ZERO;
}
+ return TypeInt::CC;
}
+};
- if (type1 == TypeLong::ZERO || type2 == TypeLong::ZERO) {
- return no_overflow(phase, ConLNode::make(phase->C, 0));
- }
-
- if (type1 == TypeLong::ONE) {
- Node* mul_result = new (phase->C) AddLNode(arg2, phase->longcon(0));
- return no_overflow(phase, mul_result);
- }
- if (type2 == TypeLong::ONE) {
- Node* mul_result = new (phase->C) AddLNode(arg1, phase->longcon(0));
- return no_overflow(phase, mul_result);
- }
+Node* OverflowINode::Ideal(PhaseGVN* phase, bool can_reshape) {
+ return IdealHelper<OverflowINode>::Ideal(this, phase, can_reshape);
+}
- if (type1 == TypeLong::MINUS_1) {
- return new (phase->C) NegExactLNode(NULL, arg2);
- }
+Node* OverflowLNode::Ideal(PhaseGVN* phase, bool can_reshape) {
+ return IdealHelper<OverflowLNode>::Ideal(this, phase, can_reshape);
+}
- if (type2 == TypeLong::MINUS_1) {
- return new (phase->C) NegExactLNode(NULL, arg1);
- }
+const Type* OverflowINode::Value(PhaseTransform* phase) const {
+ return IdealHelper<OverflowINode>::Value(this, phase);
+}
- return NULL;
+const Type* OverflowLNode::Value(PhaseTransform* phase) const {
+ return IdealHelper<OverflowLNode>::Value(this, phase);
}
diff --git a/src/share/vm/opto/mathexactnode.hpp b/src/share/vm/opto/mathexactnode.hpp
index a30304ba9..3e037cf56 100644
--- a/src/share/vm/opto/mathexactnode.hpp
+++ b/src/share/vm/opto/mathexactnode.hpp
@@ -27,128 +27,111 @@
#include "opto/multnode.hpp"
#include "opto/node.hpp"
+#include "opto/addnode.hpp"
#include "opto/subnode.hpp"
#include "opto/type.hpp"
-class BoolNode;
-class IfNode;
-class Node;
-
class PhaseGVN;
class PhaseTransform;
-class MathExactNode : public MultiNode {
+class OverflowNode : public CmpNode {
public:
- MathExactNode(Node* ctrl, Node* in1);
- MathExactNode(Node* ctrl, Node* in1, Node* in2);
- enum {
- result_proj_node = 0,
- flags_proj_node = 1
- };
- virtual int Opcode() const;
- virtual Node* Identity(PhaseTransform* phase) { return this; }
- virtual Node* Ideal(PhaseGVN* phase, bool can_reshape) { return NULL; }
- virtual const Type* Value(PhaseTransform* phase) const { return bottom_type(); }
- virtual uint hash() const { return NO_HASH; }
- virtual bool is_CFG() const { return false; }
- virtual uint ideal_reg() const { return NotAMachineReg; }
-
- ProjNode* result_node() const { return proj_out(result_proj_node); }
- ProjNode* flags_node() const { return proj_out(flags_proj_node); }
- Node* control_node() const;
- Node* non_throwing_branch() const;
-protected:
- IfNode* if_node() const;
- BoolNode* bool_node() const;
- Node* no_overflow(PhaseGVN *phase, Node* new_result);
-};
+ OverflowNode(Node* in1, Node* in2) : CmpNode(in1, in2) {}
-class MathExactINode : public MathExactNode {
- public:
- MathExactINode(Node* ctrl, Node* in1) : MathExactNode(ctrl, in1) {}
- MathExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactNode(ctrl, in1, in2) {}
- virtual int Opcode() const;
- virtual Node* match(const ProjNode* proj, const Matcher* m);
- virtual const Type* bottom_type() const { return TypeTuple::INT_CC_PAIR; }
-};
-
-class MathExactLNode : public MathExactNode {
-public:
- MathExactLNode(Node* ctrl, Node* in1) : MathExactNode(ctrl, in1) {}
- MathExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactNode(ctrl, in1, in2) {}
- virtual int Opcode() const;
- virtual Node* match(const ProjNode* proj, const Matcher* m);
- virtual const Type* bottom_type() const { return TypeTuple::LONG_CC_PAIR; }
+ virtual uint ideal_reg() const { return Op_RegFlags; }
+ virtual const Type* sub(const Type* t1, const Type* t2) const;
};
-class AddExactINode : public MathExactINode {
+class OverflowINode : public OverflowNode {
public:
- AddExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactINode(ctrl, in1, in2) {}
- virtual int Opcode() const;
- virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
-};
+ typedef TypeInt TypeClass;
-class AddExactLNode : public MathExactLNode {
-public:
- AddExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactLNode(ctrl, in1, in2) {}
- virtual int Opcode() const;
+ OverflowINode(Node* in1, Node* in2) : OverflowNode(in1, in2) {}
virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
+ virtual const Type* Value(PhaseTransform* phase) const;
+
+ virtual bool will_overflow(jint v1, jint v2) const = 0;
+ virtual bool can_overflow(const Type* t1, const Type* t2) const = 0;
};
-class SubExactINode : public MathExactINode {
+
+class OverflowLNode : public OverflowNode {
public:
- SubExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactINode(ctrl, in1, in2) {}
- virtual int Opcode() const;
+ typedef TypeLong TypeClass;
+
+ OverflowLNode(Node* in1, Node* in2) : OverflowNode(in1, in2) {}
virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
+ virtual const Type* Value(PhaseTransform* phase) const;
+
+ virtual bool will_overflow(jlong v1, jlong v2) const = 0;
+ virtual bool can_overflow(const Type* t1, const Type* t2) const = 0;
};
-class SubExactLNode : public MathExactLNode {
+class OverflowAddINode : public OverflowINode {
public:
- SubExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactLNode(ctrl, in1, in2) {}
+ typedef AddINode MathOp;
+
+ OverflowAddINode(Node* in1, Node* in2) : OverflowINode(in1, in2) {}
virtual int Opcode() const;
- virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
+
+ virtual bool will_overflow(jint v1, jint v2) const;
+ virtual bool can_overflow(const Type* t1, const Type* t2) const;
};
-class NegExactINode : public MathExactINode {
+class OverflowSubINode : public OverflowINode {
public:
- NegExactINode(Node* ctrl, Node* in1) : MathExactINode(ctrl, in1) {}
+ typedef SubINode MathOp;
+
+ OverflowSubINode(Node* in1, Node* in2) : OverflowINode(in1, in2) {}
virtual int Opcode() const;
- virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
+
+ virtual bool will_overflow(jint v1, jint v2) const;
+ virtual bool can_overflow(const Type* t1, const Type* t2) const;
};
-class NegExactLNode : public MathExactLNode {
+class OverflowMulINode : public OverflowINode {
public:
- NegExactLNode(Node* ctrl, Node* in1) : MathExactLNode(ctrl, in1) {}
+ typedef MulINode MathOp;
+
+ OverflowMulINode(Node* in1, Node* in2) : OverflowINode(in1, in2) {}
virtual int Opcode() const;
- virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
+
+ virtual bool will_overflow(jint v1, jint v2) const;
+ virtual bool can_overflow(const Type* t1, const Type* t2) const;
};
-class MulExactINode : public MathExactINode {
+class OverflowAddLNode : public OverflowLNode {
public:
- MulExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactINode(ctrl, in1, in2) {}
+ typedef AddLNode MathOp;
+
+ OverflowAddLNode(Node* in1, Node* in2) : OverflowLNode(in1, in2) {}
virtual int Opcode() const;
- virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
+
+ virtual bool will_overflow(jlong v1, jlong v2) const;
+ virtual bool can_overflow(const Type* t1, const Type* t2) const;
};
-class MulExactLNode : public MathExactLNode {
+class OverflowSubLNode : public OverflowLNode {
public:
- MulExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactLNode(ctrl, in1, in2) {}
+ typedef SubLNode MathOp;
+
+ OverflowSubLNode(Node* in1, Node* in2) : OverflowLNode(in1, in2) {}
virtual int Opcode() const;
- virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
+
+ virtual bool will_overflow(jlong v1, jlong v2) const;
+ virtual bool can_overflow(const Type* t1, const Type* t2) const;
};
-class FlagsProjNode : public ProjNode {
+class OverflowMulLNode : public OverflowLNode {
public:
- FlagsProjNode(Node* src, uint con) : ProjNode(src, con) {
- init_class_id(Class_FlagsProj);
- }
+ typedef MulLNode MathOp;
+ OverflowMulLNode(Node* in1, Node* in2) : OverflowLNode(in1, in2) {}
virtual int Opcode() const;
- virtual bool is_CFG() const { return false; }
- virtual const Type* bottom_type() const { return TypeInt::CC; }
- virtual uint ideal_reg() const { return Op_RegFlags; }
-};
+ virtual bool will_overflow(jlong v1, jlong v2) const;
+ virtual bool can_overflow(const Type* t1, const Type* t2) const;
+};
#endif
diff --git a/src/share/vm/opto/multnode.cpp b/src/share/vm/opto/multnode.cpp
index d9e04a274..300f62463 100644
--- a/src/share/vm/opto/multnode.cpp
+++ b/src/share/vm/opto/multnode.cpp
@@ -54,11 +54,6 @@ ProjNode* MultiNode::proj_out(uint which_proj) const {
assert(Opcode() != Op_If || proj->Opcode() == (which_proj?Op_IfTrue:Op_IfFalse), "bad if #2");
return proj;
}
- } else if (p->is_FlagsProj()) {
- FlagsProjNode *proj = p->as_FlagsProj();
- if (proj->_con == which_proj) {
- return proj;
- }
} else {
assert(p == this && this->is_Start(), "else must be proj");
continue;
diff --git a/src/share/vm/opto/node.hpp b/src/share/vm/opto/node.hpp
index 924db1b37..1c695f566 100644
--- a/src/share/vm/opto/node.hpp
+++ b/src/share/vm/opto/node.hpp
@@ -69,7 +69,6 @@ class EncodePNode;
class EncodePKlassNode;
class FastLockNode;
class FastUnlockNode;
-class FlagsProjNode;
class IfNode;
class IfFalseNode;
class IfTrueNode;
@@ -100,7 +99,6 @@ class MachSafePointNode;
class MachSpillCopyNode;
class MachTempNode;
class Matcher;
-class MathExactNode;
class MemBarNode;
class MemBarStoreStoreNode;
class MemNode;
@@ -569,7 +567,6 @@ public:
DEFINE_CLASS_ID(MemBar, Multi, 3)
DEFINE_CLASS_ID(Initialize, MemBar, 0)
DEFINE_CLASS_ID(MemBarStoreStore, MemBar, 1)
- DEFINE_CLASS_ID(MathExact, Multi, 4)
DEFINE_CLASS_ID(Mach, Node, 1)
DEFINE_CLASS_ID(MachReturn, Mach, 0)
@@ -626,7 +623,6 @@ public:
DEFINE_CLASS_ID(Cmp, Sub, 0)
DEFINE_CLASS_ID(FastLock, Cmp, 0)
DEFINE_CLASS_ID(FastUnlock, Cmp, 1)
- DEFINE_CLASS_ID(FlagsProj, Cmp, 2)
DEFINE_CLASS_ID(MergeMem, Node, 7)
DEFINE_CLASS_ID(Bool, Node, 8)
@@ -730,7 +726,6 @@ public:
DEFINE_CLASS_QUERY(EncodePKlass)
DEFINE_CLASS_QUERY(FastLock)
DEFINE_CLASS_QUERY(FastUnlock)
- DEFINE_CLASS_QUERY(FlagsProj)
DEFINE_CLASS_QUERY(If)
DEFINE_CLASS_QUERY(IfFalse)
DEFINE_CLASS_QUERY(IfTrue)
@@ -759,7 +754,6 @@ public:
DEFINE_CLASS_QUERY(MachSafePoint)
DEFINE_CLASS_QUERY(MachSpillCopy)
DEFINE_CLASS_QUERY(MachTemp)
- DEFINE_CLASS_QUERY(MathExact)
DEFINE_CLASS_QUERY(Mem)
DEFINE_CLASS_QUERY(MemBar)
DEFINE_CLASS_QUERY(MemBarStoreStore)
diff --git a/src/share/vm/opto/subnode.cpp b/src/share/vm/opto/subnode.cpp
index fcbead264..71ffed866 100644
--- a/src/share/vm/opto/subnode.cpp
+++ b/src/share/vm/opto/subnode.cpp
@@ -1126,11 +1126,15 @@ Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) {
Node *cmp = in(1);
if( !cmp->is_Sub() ) return NULL;
int cop = cmp->Opcode();
- if( cop == Op_FastLock || cop == Op_FastUnlock || cop == Op_FlagsProj) return NULL;
+ if( cop == Op_FastLock || cop == Op_FastUnlock) return NULL;
Node *cmp1 = cmp->in(1);
Node *cmp2 = cmp->in(2);
if( !cmp1 ) return NULL;
+ if (_test._test == BoolTest::overflow || _test._test == BoolTest::no_overflow) {
+ return NULL;
+ }
+
// Constant on left?
Node *con = cmp1;
uint op2 = cmp2->Opcode();
diff --git a/src/share/vm/opto/type.cpp b/src/share/vm/opto/type.cpp
index 181e69aca..751b3cc09 100644
--- a/src/share/vm/opto/type.cpp
+++ b/src/share/vm/opto/type.cpp
@@ -301,6 +301,7 @@ void Type::Initialize_shared(Compile* current) {
TypeInt::POS1 = TypeInt::make(1,max_jint, WidenMin); // Positive values
TypeInt::INT = TypeInt::make(min_jint,max_jint, WidenMax); // 32-bit integers
TypeInt::SYMINT = TypeInt::make(-max_jint,max_jint,WidenMin); // symmetric range
+ TypeInt::TYPE_DOMAIN = TypeInt::INT;
// CmpL is overloaded both as the bytecode computation returning
// a trinary (-1,0,+1) integer result AND as an efficient long
// compare returning optimizer ideal-type flags.
@@ -317,6 +318,7 @@ void Type::Initialize_shared(Compile* current) {
TypeLong::LONG = TypeLong::make(min_jlong,max_jlong,WidenMax); // 64-bit integers
TypeLong::INT = TypeLong::make((jlong)min_jint,(jlong)max_jint,WidenMin);
TypeLong::UINT = TypeLong::make(0,(jlong)max_juint,WidenMin);
+ TypeLong::TYPE_DOMAIN = TypeLong::LONG;
const Type **fboth =(const Type**)shared_type_arena->Amalloc_4(2*sizeof(Type*));
fboth[0] = Type::CONTROL;
@@ -1156,6 +1158,7 @@ const TypeInt *TypeInt::POS; // Positive 32-bit integers or zero
const TypeInt *TypeInt::POS1; // Positive 32-bit integers
const TypeInt *TypeInt::INT; // 32-bit integers
const TypeInt *TypeInt::SYMINT; // symmetric range [-max_jint..max_jint]
+const TypeInt *TypeInt::TYPE_DOMAIN; // alias for TypeInt::INT
//------------------------------TypeInt----------------------------------------
TypeInt::TypeInt( jint lo, jint hi, int w ) : Type(Int), _lo(lo), _hi(hi), _widen(w) {
@@ -1413,6 +1416,7 @@ const TypeLong *TypeLong::POS; // >=0
const TypeLong *TypeLong::LONG; // 64-bit integers
const TypeLong *TypeLong::INT; // 32-bit subrange
const TypeLong *TypeLong::UINT; // 32-bit unsigned subrange
+const TypeLong *TypeLong::TYPE_DOMAIN; // alias for TypeLong::LONG
//------------------------------TypeLong---------------------------------------
TypeLong::TypeLong( jlong lo, jlong hi, int w ) : Type(Long), _lo(lo), _hi(hi), _widen(w) {
diff --git a/src/share/vm/opto/type.hpp b/src/share/vm/opto/type.hpp
index 747c29c5d..418dd495d 100644
--- a/src/share/vm/opto/type.hpp
+++ b/src/share/vm/opto/type.hpp
@@ -489,6 +489,7 @@ protected:
virtual const Type *filter_helper(const Type *kills, bool include_speculative) const;
public:
+ typedef jint NativeType;
virtual bool eq( const Type *t ) const;
virtual int hash() const; // Type specific hashing
virtual bool singleton(void) const; // TRUE if type is a singleton
@@ -531,6 +532,9 @@ public:
static const TypeInt *POS1;
static const TypeInt *INT;
static const TypeInt *SYMINT; // symmetric range [-max_jint..max_jint]
+ static const TypeInt *TYPE_DOMAIN; // alias for TypeInt::INT
+
+ static const TypeInt *as_self(const Type *t) { return t->is_int(); }
#ifndef PRODUCT
virtual void dump2( Dict &d, uint depth, outputStream *st ) const;
#endif
@@ -546,6 +550,7 @@ protected:
// Do not kill _widen bits.
virtual const Type *filter_helper(const Type *kills, bool include_speculative) const;
public:
+ typedef jlong NativeType;
virtual bool eq( const Type *t ) const;
virtual int hash() const; // Type specific hashing
virtual bool singleton(void) const; // TRUE if type is a singleton
@@ -565,6 +570,7 @@ public:
virtual bool is_finite() const; // Has a finite value
+
virtual const Type *xmeet( const Type *t ) const;
virtual const Type *xdual() const; // Compute dual right now.
virtual const Type *widen( const Type *t, const Type* limit_type ) const;
@@ -577,6 +583,11 @@ public:
static const TypeLong *LONG;
static const TypeLong *INT; // 32-bit subrange [min_jint..max_jint]
static const TypeLong *UINT; // 32-bit unsigned [0..max_juint]
+ static const TypeLong *TYPE_DOMAIN; // alias for TypeLong::LONG
+
+ // static convenience methods.
+ static const TypeLong *as_self(const Type *t) { return t->is_long(); }
+
#ifndef PRODUCT
virtual void dump2( Dict &d, uint, outputStream *st ) const;// Specialized per-Type dumping
#endif
diff --git a/src/share/vm/runtime/vmStructs.cpp b/src/share/vm/runtime/vmStructs.cpp
index c1191a056..55d8cdcf0 100644
--- a/src/share/vm/runtime/vmStructs.cpp
+++ b/src/share/vm/runtime/vmStructs.cpp
@@ -1938,15 +1938,6 @@ typedef BinaryTreeDictionary<Metablock, FreeList<Metablock> > MetablockTreeDicti
declare_c2_type(CmpF3Node, CmpFNode) \
declare_c2_type(CmpDNode, CmpNode) \
declare_c2_type(CmpD3Node, CmpDNode) \
- declare_c2_type(MathExactNode, MultiNode) \
- declare_c2_type(MathExactINode, MathExactNode) \
- declare_c2_type(AddExactINode, MathExactINode) \
- declare_c2_type(AddExactLNode, MathExactLNode) \
- declare_c2_type(SubExactINode, MathExactINode) \
- declare_c2_type(SubExactLNode, MathExactLNode) \
- declare_c2_type(NegExactINode, MathExactINode) \
- declare_c2_type(MulExactINode, MathExactINode) \
- declare_c2_type(FlagsProjNode, ProjNode) \
declare_c2_type(BoolNode, Node) \
declare_c2_type(AbsNode, Node) \
declare_c2_type(AbsINode, AbsNode) \
@@ -2027,6 +2018,15 @@ typedef BinaryTreeDictionary<Metablock, FreeList<Metablock> > MetablockTreeDicti
declare_c2_type(ExtractLNode, ExtractNode) \
declare_c2_type(ExtractFNode, ExtractNode) \
declare_c2_type(ExtractDNode, ExtractNode) \
+ declare_c2_type(OverflowNode, CmpNode) \
+ declare_c2_type(OverflowINode, OverflowNode) \
+ declare_c2_type(OverflowAddINode, OverflowINode) \
+ declare_c2_type(OverflowSubINode, OverflowINode) \
+ declare_c2_type(OverflowMulINode, OverflowINode) \
+ declare_c2_type(OverflowLNode, OverflowNode) \
+ declare_c2_type(OverflowAddLNode, OverflowLNode) \
+ declare_c2_type(OverflowSubLNode, OverflowLNode) \
+ declare_c2_type(OverflowMulLNode, OverflowLNode) \
\
/*********************/ \
/* Adapter Blob Entries */ \
diff --git a/test/compiler/intrinsics/mathexact/AddExactICondTest.java b/test/compiler/intrinsics/mathexact/AddExactICondTest.java
index f0835cdb1..8862160d8 100644
--- a/test/compiler/intrinsics/mathexact/AddExactICondTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactICondTest.java
@@ -26,7 +26,7 @@
* @bug 8024924
* @summary Test non constant addExact
* @compile AddExactICondTest.java
- * @run main AddExactICondTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main AddExactICondTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java b/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java
index ed8525483..77000a1d9 100644
--- a/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8024924
* @summary Test constant addExact
* @compile AddExactIConstantTest.java Verify.java
- * @run main AddExactIConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main AddExactIConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/AddExactILoadTest.java b/test/compiler/intrinsics/mathexact/AddExactILoadTest.java
index 4175a8ab5..2d96bb8b8 100644
--- a/test/compiler/intrinsics/mathexact/AddExactILoadTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactILoadTest.java
@@ -26,7 +26,7 @@
* @bug 8024924
* @summary Test non constant addExact
* @compile AddExactILoadTest.java Verify.java
- * @run main AddExactILoadTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main AddExactILoadTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java b/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java
index 56da9f40b..99aae0d7b 100644
--- a/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java
@@ -26,7 +26,7 @@
* @bug 8024924
* @summary Test non constant addExact
* @compile AddExactILoopDependentTest.java Verify.java
- * @run main AddExactILoopDependentTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main AddExactILoopDependentTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java b/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java
index 52e208db0..b3a247585 100644
--- a/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8024924
* @summary Test non constant addExact
* @compile AddExactINonConstantTest.java Verify.java
- * @run main AddExactINonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main AddExactINonConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java b/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
index 7bb1deba0..d111b66ce 100644
--- a/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java
@@ -26,7 +26,7 @@
* @bug 8025657
* @summary Test repeating addExact
* @compile AddExactIRepeatTest.java Verify.java
- * @run main AddExactIRepeatTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main AddExactIRepeatTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java b/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java
index 3514ce24a..dc7514061 100644
--- a/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test constant addExact
* @compile AddExactLConstantTest.java Verify.java
- * @run main AddExactLConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main AddExactLConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java b/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java
index 3e16cb94d..efd5fd7c9 100644
--- a/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test non constant addExact
* @compile AddExactLNonConstantTest.java Verify.java
- * @run main AddExactLNonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main AddExactLNonConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/CompareTest.java b/test/compiler/intrinsics/mathexact/CompareTest.java
index c77dd47c1..f6785c07c 100644
--- a/test/compiler/intrinsics/mathexact/CompareTest.java
+++ b/test/compiler/intrinsics/mathexact/CompareTest.java
@@ -26,7 +26,7 @@
* @bug 8026722
* @summary Verify that the compare after addExact is a signed compare
* @compile CompareTest.java
- * @run main CompareTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main CompareTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/DecExactITest.java b/test/compiler/intrinsics/mathexact/DecExactITest.java
index 2712bed78..7e6e1ca3b 100644
--- a/test/compiler/intrinsics/mathexact/DecExactITest.java
+++ b/test/compiler/intrinsics/mathexact/DecExactITest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test decrementExact
* @compile DecExactITest.java Verify.java
- * @run main DecExactITest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main DecExactITest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/DecExactLTest.java b/test/compiler/intrinsics/mathexact/DecExactLTest.java
index ad83dcad2..53a16596e 100644
--- a/test/compiler/intrinsics/mathexact/DecExactLTest.java
+++ b/test/compiler/intrinsics/mathexact/DecExactLTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test decrementExact
* @compile DecExactLTest.java Verify.java
- * @run main DecExactLTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main DecExactLTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/GVNTest.java b/test/compiler/intrinsics/mathexact/GVNTest.java
index 864555e2b..23fba15d4 100644
--- a/test/compiler/intrinsics/mathexact/GVNTest.java
+++ b/test/compiler/intrinsics/mathexact/GVNTest.java
@@ -26,7 +26,7 @@
* @bug 8028207
* @summary Verify that GVN doesn't mess up the two addExacts
* @compile GVNTest.java
- * @run main GVNTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main GVNTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/IncExactITest.java b/test/compiler/intrinsics/mathexact/IncExactITest.java
index 41ab82584..9f7ddbd32 100644
--- a/test/compiler/intrinsics/mathexact/IncExactITest.java
+++ b/test/compiler/intrinsics/mathexact/IncExactITest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test incrementExact
* @compile IncExactITest.java Verify.java
- * @run main IncExactITest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main IncExactITest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/IncExactLTest.java b/test/compiler/intrinsics/mathexact/IncExactLTest.java
index 6ece9792b..755d81908 100644
--- a/test/compiler/intrinsics/mathexact/IncExactLTest.java
+++ b/test/compiler/intrinsics/mathexact/IncExactLTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test incrementExact
* @compile IncExactLTest.java Verify.java
- * @run main IncExactLTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main IncExactLTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/MulExactICondTest.java b/test/compiler/intrinsics/mathexact/MulExactICondTest.java
index e9bf6b995..5f3e1e645 100644
--- a/test/compiler/intrinsics/mathexact/MulExactICondTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactICondTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test multiplyExact as condition
* @compile MulExactICondTest.java
- * @run main MulExactICondTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main MulExactICondTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java b/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java
index 6bb74d1f9..120bef5e9 100644
--- a/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test constant multiplyExact
* @compile MulExactIConstantTest.java Verify.java
- * @run main MulExactIConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main MulExactIConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/MulExactILoadTest.java b/test/compiler/intrinsics/mathexact/MulExactILoadTest.java
index 8878b6f1c..36aa3d462 100644
--- a/test/compiler/intrinsics/mathexact/MulExactILoadTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactILoadTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test multiplyExact
* @compile MulExactILoadTest.java Verify.java
- * @run main MulExactILoadTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main MulExactILoadTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java b/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java
index 7c5c7e7a2..5ba4ad3cf 100644
--- a/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test loop dependent multiplyExact
* @compile MulExactILoopDependentTest.java Verify.java
- * @run main MulExactILoopDependentTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main MulExactILoopDependentTest
*
*/
public class MulExactILoopDependentTest {
diff --git a/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java b/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java
index e924311aa..e10805988 100644
--- a/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test non constant multiplyExact
* @compile MulExactINonConstantTest.java Verify.java
- * @run main MulExactINonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main MulExactINonConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java b/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java
index 5d5a93d05..dd14ce21e 100644
--- a/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test repeating multiplyExact
* @compile MulExactIRepeatTest.java Verify.java
- * @run main MulExactIRepeatTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main MulExactIRepeatTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java b/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java
index 9668ddfe0..c687cc276 100644
--- a/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test constant mulExact
* @compile MulExactLConstantTest.java Verify.java
- * @run main MulExactLConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main MulExactLConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java b/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java
index 3486588c8..f9d82ed08 100644
--- a/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test non constant mulExact
* @compile MulExactLNonConstantTest.java Verify.java
- * @run main MulExactLNonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main MulExactLNonConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java b/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java
index 0a5e164ba..ba49d7787 100644
--- a/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test constant negExact
* @compile NegExactIConstantTest.java Verify.java
- * @run main NegExactIConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main NegExactIConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/NegExactILoadTest.java b/test/compiler/intrinsics/mathexact/NegExactILoadTest.java
index e7896835e..d7e821560 100644
--- a/test/compiler/intrinsics/mathexact/NegExactILoadTest.java
+++ b/test/compiler/intrinsics/mathexact/NegExactILoadTest.java
@@ -26,14 +26,14 @@
* @bug 8026844
* @summary Test negExact
* @compile NegExactILoadTest.java Verify.java
- * @run main NegExactILoadTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main NegExactILoadTest
*
*/
public class NegExactILoadTest {
public static void main(String[] args) {
- Verify.LoadTest.init();
- Verify.LoadTest.verify(new Verify.UnaryToBinary(new Verify.NegExactI()));
+ Verify.LoadTest.init();
+ Verify.LoadTest.verify(new Verify.UnaryToBinary(new Verify.NegExactI()));
}
}
diff --git a/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java b/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java
index a18b0c17e..882f80b91 100644
--- a/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java
+++ b/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test negExact loop dependent
* @compile NegExactILoopDependentTest.java Verify.java
- * @run main NegExactILoopDependentTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main NegExactILoopDependentTest
*
*/
public class NegExactILoopDependentTest {
diff --git a/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java b/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java
index ee87bd827..6f044f0d9 100644
--- a/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test non constant negExact
* @compile NegExactINonConstantTest.java Verify.java
- * @run main NegExactINonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main NegExactINonConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java b/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java
index 82e02a960..382cd5c5f 100644
--- a/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test constant negExact
* @compile NegExactLConstantTest.java Verify.java
- * @run main NegExactLConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main NegExactLConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java b/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java
index b7b967dc2..0bcad8b2b 100644
--- a/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test constant negExact
* @compile NegExactLNonConstantTest.java Verify.java
- * @run main NegExactLNonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main NegExactLNonConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/NestedMathExactTest.java b/test/compiler/intrinsics/mathexact/NestedMathExactTest.java
index 883fcceac..211dc8baf 100644
--- a/test/compiler/intrinsics/mathexact/NestedMathExactTest.java
+++ b/test/compiler/intrinsics/mathexact/NestedMathExactTest.java
@@ -26,7 +26,7 @@
* @bug 8027444
* @summary Test nested loops
* @compile NestedMathExactTest.java
- * @run main NestedMathExactTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main NestedMathExactTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/SplitThruPhiTest.java b/test/compiler/intrinsics/mathexact/SplitThruPhiTest.java
index 67f3afab0..b3b0c0d74 100644
--- a/test/compiler/intrinsics/mathexact/SplitThruPhiTest.java
+++ b/test/compiler/intrinsics/mathexact/SplitThruPhiTest.java
@@ -26,7 +26,7 @@
* @bug 8028198
* @summary Verify that split through phi does the right thing
* @compile SplitThruPhiTest.java
- * @run main SplitThruPhiTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main SplitThruPhiTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/SubExactICondTest.java b/test/compiler/intrinsics/mathexact/SubExactICondTest.java
index b4dd4f7da..f539bdc7c 100644
--- a/test/compiler/intrinsics/mathexact/SubExactICondTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactICondTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test subtractExact as condition
* @compile SubExactICondTest.java Verify.java
- * @run main SubExactICondTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main SubExactICondTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java b/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java
index 20a27cef1..b450bd90b 100644
--- a/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test constant subtractExact
* @compile SubExactIConstantTest.java Verify.java
- * @run main SubExactIConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main SubExactIConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/SubExactILoadTest.java b/test/compiler/intrinsics/mathexact/SubExactILoadTest.java
index 5be582fd0..af2ed0182 100644
--- a/test/compiler/intrinsics/mathexact/SubExactILoadTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactILoadTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test non constant subtractExact
* @compile SubExactILoadTest.java Verify.java
- * @run main SubExactILoadTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main SubExactILoadTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java b/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java
index b4e7b4a30..67ebcbca3 100644
--- a/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test non constant subtractExact
* @compile SubExactILoopDependentTest.java Verify.java
- * @run main SubExactILoopDependentTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main SubExactILoopDependentTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java b/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java
index 82dc81c3d..b81538108 100644
--- a/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test non constant subtractExact
* @compile SubExactINonConstantTest.java Verify.java
- * @run main SubExactINonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main SubExactINonConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java b/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
index 63e4b3d18..3c57f6f3f 100644
--- a/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java
@@ -26,7 +26,7 @@
* @bug 8026844
* @summary Test repeating subtractExact
* @compile SubExactIRepeatTest.java Verify.java
- * @run main SubExactIRepeatTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main SubExactIRepeatTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java b/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java
index 973aa6a39..ec554d766 100644
--- a/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java
@@ -27,7 +27,7 @@
* @bug 8027353
* @summary Test constant subtractExact
* @compile SubExactLConstantTest.java Verify.java
- * @run main SubExactLConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main SubExactLConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java b/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java
index bc0c7331b..86ecf20f3 100644
--- a/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java
+++ b/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java
@@ -27,7 +27,7 @@
* @bug 8027353
* @summary Test non constant subtractExact
* @compile SubExactLNonConstantTest.java Verify.java
- * @run main SubExactLNonConstantTest -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseMathExactIntrinsics
+ * @run main SubExactLNonConstantTest
*
*/
diff --git a/test/compiler/intrinsics/mathexact/Verify.java b/test/compiler/intrinsics/mathexact/Verify.java
index a4d728bfd..3936bf1b4 100644
--- a/test/compiler/intrinsics/mathexact/Verify.java
+++ b/test/compiler/intrinsics/mathexact/Verify.java
@@ -160,6 +160,7 @@ public class Verify {
public static class NonConstantTest {
public static java.util.Random rnd = new java.util.Random();
+ public static int[] values = new int[] { Integer.MAX_VALUE, Integer.MIN_VALUE };
public static void verify(BinaryMethod method) {
for (int i = 0; i < 50000; ++i) {
@@ -169,6 +170,10 @@ public class Verify {
Verify.verifyBinary(rnd1 + 1, rnd2, method);
Verify.verifyBinary(rnd1 - 1, rnd2, method);
Verify.verifyBinary(rnd1, rnd2 - 1, method);
+ Verify.verifyBinary(0, values[0], method);
+ Verify.verifyBinary(values[0], 0, method);
+ Verify.verifyBinary(0, values[1], method);
+ Verify.verifyBinary(values[1], 0, method);
}
}
}
diff --git a/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java b/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java
index c55f847d2..a2770dcdd 100644
--- a/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java
@@ -26,11 +26,11 @@
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build AddExactIntTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics AddExactIntTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics AddExactIntTest
diff --git a/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java b/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java
index 4823f073f..c57564407 100644
--- a/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java
@@ -26,11 +26,11 @@
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build AddExactLongTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics AddExactLongTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics AddExactLongTest
diff --git a/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java b/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java
index 0b97ab86a..19641a1f4 100644
--- a/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java
@@ -26,11 +26,11 @@
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build DecrementExactIntTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics DecrementExactIntTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics DecrementExactIntTest
diff --git a/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java b/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java
index f2429aa91..a5821698f 100644
--- a/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java
@@ -26,11 +26,11 @@
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build DecrementExactLongTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics DecrementExactLongTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics DecrementExactLongTest
@@ -42,4 +42,4 @@ public class DecrementExactLongTest {
public static void main(String[] args) throws Exception {
new IntrinsicBase.LongTest(MathIntrinsic.LongIntrinsic.Decrement).test();
}
-} \ No newline at end of file
+}
diff --git a/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java b/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java
index 714f4e2e0..bca840ad8 100644
--- a/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java
@@ -26,11 +26,11 @@
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build IncrementExactIntTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics IncrementExactIntTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics IncrementExactIntTest
diff --git a/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java b/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java
index 19511c499..5348b774f 100644
--- a/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java
@@ -26,11 +26,11 @@
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build IncrementExactLongTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics IncrementExactLongTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics IncrementExactLongTest
diff --git a/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java b/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java
index bd4335001..a09c12449 100644
--- a/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java
@@ -26,11 +26,11 @@
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build MultiplyExactIntTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics MultiplyExactIntTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics MultiplyExactIntTest
diff --git a/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java b/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java
index 70651107d..23154e9ec 100644
--- a/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java
@@ -26,11 +26,11 @@
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build MultiplyExactLongTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics MultiplyExactLongTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics MultiplyExactLongTest
diff --git a/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java b/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java
index 579c2907e..f41bb7995 100644
--- a/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java
@@ -26,11 +26,11 @@
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build NegateExactIntTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics NegateExactIntTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics NegateExactIntTest
diff --git a/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java b/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java
index 6f114f632..27af65530 100644
--- a/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java
@@ -26,11 +26,11 @@
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build NegateExactLongTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics NegateExactLongTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics NegateExactLongTest
diff --git a/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java b/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java
index d1eaf3919..c2cbbc4ef 100644
--- a/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java
@@ -26,11 +26,11 @@
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build SubtractExactIntTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics SubtractExactIntTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics SubtractExactIntTest
diff --git a/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java b/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java
index fbe8eb1e1..bee6d3baf 100644
--- a/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java
+++ b/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java
@@ -26,11 +26,11 @@
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build SubtractExactLongTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs_neg.log -XX:-UseMathExactIntrinsics SubtractExactLongTest
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation
* -XX:CompileCommand=compileonly,MathIntrinsic*::execMathMethod
* -XX:LogFile=hs.log -XX:+UseMathExactIntrinsics SubtractExactLongTest