changeset 58900:7869415891c8 vectorIntrinsics

JDK-8221932: [vector] Add x86 optimized implementation for float/double Min/Max reduction Summary: Code gen support for x86 and corrected initial value in API implementation Reviewed-by: sviswanathan Contributed-by: jatin.bhateja@intel.com
author sviswanathan
date Wed, 03 Apr 2019 13:12:05 -0700
parents 1bdca2cf660e
children 21f94abc4b32
files src/hotspot/cpu/x86/assembler_x86.cpp src/hotspot/cpu/x86/assembler_x86.hpp src/hotspot/cpu/x86/macroAssembler_x86.cpp src/hotspot/cpu/x86/macroAssembler_x86.hpp src/hotspot/cpu/x86/x86.ad src/hotspot/share/opto/vectornode.cpp src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template src/jdk.incubator.vector/share/classes/jdk/incubator/vector/gen-src.sh test/jdk/jdk/incubator/vector/Double128VectorTests.java test/jdk/jdk/incubator/vector/Double256VectorTests.java test/jdk/jdk/incubator/vector/Double512VectorTests.java test/jdk/jdk/incubator/vector/Double64VectorTests.java test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.java test/jdk/jdk/incubator/vector/Float128VectorTests.java test/jdk/jdk/incubator/vector/Float256VectorTests.java test/jdk/jdk/incubator/vector/Float512VectorTests.java test/jdk/jdk/incubator/vector/Float64VectorTests.java test/jdk/jdk/incubator/vector/FloatMaxVectorTests.java test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double128Vector.java test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double256Vector.java test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double512Vector.java test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double64Vector.java test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/DoubleMaxVector.java test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/DoubleScalar.java test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float128Vector.java test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float256Vector.java test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float512Vector.java test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float64Vector.java test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/FloatMaxVector.java test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/FloatScalar.java test/jdk/jdk/incubator/vector/gen-template.sh test/jdk/jdk/incubator/vector/gen-tests.sh
diffstat 41 files changed, 970 insertions(+), 715 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/cpu/x86/assembler_x86.cpp	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/hotspot/cpu/x86/assembler_x86.cpp	Wed Apr 03 13:12:05 2019 -0700
@@ -2899,6 +2899,7 @@
 
 void Assembler::evmovdquq(XMMRegister dst, XMMRegister src, int vector_len) {
   // Unmasked instruction
+  if (dst->encoding() == src->encoding()) return;
   evmovdquq(dst, k0, src, /*merge*/ false, vector_len);
 }
 
@@ -3775,17 +3776,27 @@
 }
 
 void Assembler::vpermilps(XMMRegister dst, XMMRegister src, int imm8, int vector_len) {
-  assert(VM_Version::supports_avx(), "");
-  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
+  assert(vector_len <= AVX_256bit ? VM_Version::supports_avx() : VM_Version::supports_evex(), "");
+  InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x04);
   emit_int8((unsigned char)(0xC0 | encode));
   emit_int8(imm8);
 }
 
+void Assembler::vpermilpd(XMMRegister dst, XMMRegister src, int imm8, int vector_len) {
+  assert(vector_len <= AVX_256bit ? VM_Version::supports_avx() : VM_Version::supports_evex(), "");
+  InstructionAttr attributes(vector_len, /* rex_w */ VM_Version::supports_evex(),/* legacy_mode */ false,/* no_mask_reg */ true, /* uses_vl */ false);
+  attributes.set_rex_vex_w_reverted();
+  int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
+  emit_int8(0x05);
+  emit_int8((unsigned char)(0xC0 | encode));
+  emit_int8(imm8);
+}
+
 void Assembler::vpermpd(XMMRegister dst, XMMRegister src, int imm8, int vector_len) {
   assert(vector_len <= AVX_256bit ? VM_Version::supports_avx2() : VM_Version::supports_evex(), "");
-  InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);
+  InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */false, /* no_mask_reg */ true, /* uses_vl */ false);
   int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
   emit_int8(0x01);
   emit_int8((unsigned char)(0xC0 | encode));
--- a/src/hotspot/cpu/x86/assembler_x86.hpp	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/hotspot/cpu/x86/assembler_x86.hpp	Wed Apr 03 13:12:05 2019 -0700
@@ -1679,6 +1679,7 @@
   void vperm2i128(XMMRegister dst,  XMMRegister nds, XMMRegister src, int imm8);
   void vperm2f128(XMMRegister dst, XMMRegister nds, XMMRegister src, int imm8);
   void vpermilps(XMMRegister dst, XMMRegister src, int imm8, int vector_len);
+  void vpermilpd(XMMRegister dst, XMMRegister src, int imm8, int vector_len);
   void vpermpd(XMMRegister dst, XMMRegister src, int imm8, int vector_len);
   void evpermi2q(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len);
 
--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Wed Apr 03 13:12:05 2019 -0700
@@ -114,6 +114,7 @@
   cmp_literal32(src1, (int32_t)obj, metadata_Relocation::spec_for_immediate());
 }
 
+
 void MacroAssembler::cmpklass(Register src1, Metadata* obj) {
   cmp_literal32(src1, (int32_t)obj, metadata_Relocation::spec_for_immediate());
 }
@@ -512,6 +513,71 @@
 
 #else // _LP64
 
+void MacroAssembler::vmin_max_macro_evex(XMMRegister dst, XMMRegister a, XMMRegister b,
+                                         KRegister ktmp, XMMRegister atmp, XMMRegister btmp,
+                                         bool is_single, bool is_min, int vector_len) {
+  if (is_single && is_min) {
+    evpmovd2m(ktmp, a, vector_len);
+    evblendmps(atmp, ktmp, a, b, true, vector_len);
+    evblendmps(btmp, ktmp, b, a, true, vector_len);
+    vminps(dst, atmp, btmp, vector_len);
+    evcmpps(ktmp, k0, atmp, atmp, Assembler::UNORD_Q, vector_len);
+    evmovdqul(dst, ktmp, atmp, true, vector_len);
+  } else if (is_single && !is_min) {
+    evpmovd2m(ktmp, b, vector_len);
+    evblendmps(atmp, ktmp, a, b, true, vector_len);
+    evblendmps(btmp, ktmp, b, a, true, vector_len);
+    vmaxps(dst, atmp, btmp, vector_len);
+    evcmpps(ktmp, k0, atmp, atmp, Assembler::UNORD_Q, vector_len);
+    evmovdqul(dst, ktmp, atmp, true, vector_len);
+  } else if (!is_single && is_min) {
+    evpmovq2m(ktmp, a, vector_len);
+    evblendmpd(atmp, ktmp, a, b, true, vector_len);
+    evblendmpd(btmp, ktmp, b, a, true, vector_len);
+    vminpd(dst, atmp, btmp, vector_len);
+    evcmppd(ktmp, k0, atmp, atmp, Assembler::UNORD_Q, vector_len);
+    evmovdquq(dst, ktmp, atmp, true, vector_len);
+  } else {
+    evpmovq2m(ktmp, b, vector_len);
+    evblendmpd(atmp, ktmp, a, b, true, vector_len);
+    evblendmpd(btmp, ktmp, b, a, true, vector_len);
+    vmaxpd(dst, atmp, btmp, vector_len);
+    evcmppd(ktmp, k0, atmp, atmp, Assembler::UNORD_Q, vector_len);
+    evmovdquq(dst, ktmp, atmp, true, vector_len);
+  }
+}
+
+void MacroAssembler::vmin_max_macro(XMMRegister dst, XMMRegister a, XMMRegister b,
+                                    XMMRegister tmp, XMMRegister atmp, XMMRegister btmp,
+                                    bool is_single, bool is_min, int vector_len) {
+  if (is_single && is_min) {
+    vblendvps(atmp, a, b, a, vector_len);
+    vblendvps(btmp, b, a, a, vector_len);
+    vminps(tmp, atmp, btmp, vector_len);
+    vcmpps(btmp, atmp, atmp, Assembler::UNORD_Q, vector_len);
+    vblendvps(dst, tmp, atmp, btmp, vector_len);
+  } else if (is_single && !is_min) {
+    vblendvps(btmp, b, a, b, vector_len);
+    vblendvps(atmp, a, b, b, vector_len);
+    vmaxps(tmp, atmp, btmp, vector_len);
+    vcmpps(btmp, atmp, atmp, Assembler::UNORD_Q, vector_len);
+    vblendvps(dst, tmp, atmp, btmp, vector_len);
+  } else if (!is_single && is_min) {
+    vblendvpd(atmp, a, b, a, vector_len);
+    vblendvpd(btmp, b, a, a, vector_len);
+    vminpd(tmp, atmp, btmp, vector_len);
+    vcmppd(btmp, atmp, atmp, Assembler::UNORD_Q, vector_len);
+    vblendvpd(dst, tmp, atmp, btmp, vector_len);
+  } else {
+    vblendvpd(btmp, b, a, b, vector_len);
+    vblendvpd(atmp, a, b, b, vector_len);
+    vmaxpd(tmp, atmp, btmp, vector_len);
+    vcmppd(btmp, atmp, atmp, Assembler::UNORD_Q, vector_len);
+    vblendvpd(dst, tmp, atmp, btmp, vector_len);
+  }
+}
+
+
 // 64 bit versions
 
 Address MacroAssembler::as_Address(AddressLiteral adr) {
@@ -3313,6 +3379,7 @@
 
 void MacroAssembler::movdqu(XMMRegister dst, XMMRegister src) {
     assert(((dst->encoding() < 16  && src->encoding() < 16) || VM_Version::supports_avx512vl()),"XMM register should be 0-15");
+    if (dst->encoding() == src->encoding()) return;
     Assembler::movdqu(dst, src);
 }
 
@@ -3337,6 +3404,7 @@
 
 void MacroAssembler::vmovdqu(XMMRegister dst, XMMRegister src) {
     assert(((dst->encoding() < 16  && src->encoding() < 16) || VM_Version::supports_avx512vl()),"XMM register should be 0-15");
+    if (dst->encoding() == src->encoding()) return;
     Assembler::vmovdqu(dst, src);
 }
 
--- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp	Wed Apr 03 13:12:05 2019 -0700
@@ -914,6 +914,14 @@
   void ldmxcsr(Address src) { Assembler::ldmxcsr(src); }
   void ldmxcsr(AddressLiteral src);
 
+  void vmin_max_macro(XMMRegister dst, XMMRegister a, XMMRegister b,
+                         XMMRegister tmp, XMMRegister atmp, XMMRegister btmp,
+                         bool is_single, bool is_min, int vector_len);
+
+  void vmin_max_macro_evex(XMMRegister dst, XMMRegister a, XMMRegister b,
+                           KRegister ktmp, XMMRegister atmp, XMMRegister btmp,
+                           bool is_single, bool is_min, int vector_len);
+
 #ifdef _LP64
  private:
   void sha256_AVX2_one_round_compute(
@@ -1126,18 +1134,30 @@
 
   void evmovdqul(Address dst, XMMRegister src, int vector_len) { Assembler::evmovdqul(dst, src, vector_len); }
   void evmovdqul(XMMRegister dst, Address src, int vector_len) { Assembler::evmovdqul(dst, src, vector_len); }
-  void evmovdqul(XMMRegister dst, XMMRegister src, int vector_len) { Assembler::evmovdqul(dst, src, vector_len); }
+  void evmovdqul(XMMRegister dst, XMMRegister src, int vector_len) {
+     if (dst->encoding() == src->encoding()) return;
+     Assembler::evmovdqul(dst, src, vector_len); 
+  }
   void evmovdqul(Address dst, KRegister mask, XMMRegister src, bool merge, int vector_len) { Assembler::evmovdqul(dst, mask, src, merge, vector_len); }
   void evmovdqul(XMMRegister dst, KRegister mask, Address src, bool merge, int vector_len) { Assembler::evmovdqul(dst, mask, src, merge, vector_len); }
-  void evmovdqul(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len) { Assembler::evmovdqul(dst, mask, src, merge, vector_len); }
+  void evmovdqul(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len) { 
+    if (dst->encoding() == src->encoding() && mask == k0) return;
+    Assembler::evmovdqul(dst, mask, src, merge, vector_len);
+   }
   void evmovdqul(XMMRegister dst, KRegister mask, AddressLiteral src, bool merge, int vector_len, Register scratch_reg);
 
   void evmovdquq(Address dst, XMMRegister src, int vector_len) { Assembler::evmovdquq(dst, src, vector_len); }
   void evmovdquq(XMMRegister dst, Address src, int vector_len) { Assembler::evmovdquq(dst, src, vector_len); }
-  void evmovdquq(XMMRegister dst, XMMRegister src, int vector_len) { Assembler::evmovdquq(dst, src, vector_len); }
+  void evmovdquq(XMMRegister dst, XMMRegister src, int vector_len) {
+    if (dst->encoding() == src->encoding()) return;
+    Assembler::evmovdquq(dst, src, vector_len); 
+  }
   void evmovdquq(Address dst, KRegister mask, XMMRegister src, bool merge, int vector_len) { Assembler::evmovdquq(dst, mask, src, merge, vector_len); }
   void evmovdquq(XMMRegister dst, KRegister mask, Address src, bool merge, int vector_len) { Assembler::evmovdquq(dst, mask, src, merge, vector_len); }
-  void evmovdquq(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len) { Assembler::evmovdquq(dst, mask, src, merge, vector_len); }
+  void evmovdquq(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len) { 
+    if (dst->encoding() == src->encoding() && mask == k0) return;
+    Assembler::evmovdquq(dst, mask, src, merge, vector_len); 
+  }
   void evmovdquq(XMMRegister dst, KRegister mask, AddressLiteral src, bool merge, int vector_len, Register scratch_reg);
   void evmovdquq(XMMRegister dst, AddressLiteral src, int vector_len, Register rscratch);
 
--- a/src/hotspot/cpu/x86/x86.ad	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/hotspot/cpu/x86/x86.ad	Wed Apr 03 13:12:05 2019 -0700
@@ -1515,7 +1515,7 @@
             ret_value = false;
 
           if ((bt == T_FLOAT || bt == T_DOUBLE)) {
-            // Float/Double intrinsics are handled for targets supporting AVX family.
+            // Float/Double intrinsics are enabled for AVX family currently.
             if (UseAVX == 0)
               ret_value = false;
             // 512 bit Float/Double intrinsics need AVX512DQ
@@ -1581,8 +1581,10 @@
           if ((bt == T_INT || bt == T_LONG || bt == T_BYTE) && UseSSE <= 3) { ret_value = false; }
           else if (is_integral_type(bt) && size_in_bits == 256 && UseAVX < 2) { ret_value = false; }
 
-          // Float/Double intrinsics disabled till we fix the implementation to match Math.max/Math.min
-          if (bt == T_FLOAT || bt == T_DOUBLE)
+          // Float/Double intrinsics enabled for AVX family.
+          if (UseAVX == 0 && (bt == T_FLOAT || bt == T_DOUBLE))
+            ret_value = false;
+          if (UseAVX > 2 && (!VM_Version::supports_avx512dq() && size_in_bits == 512))
             ret_value = false;
           break;
         case Op_VectorBlend:
@@ -2155,6 +2157,8 @@
     return MachNode::size(ra_);
   }
 
+  
+
 %}
 
 encode %{
@@ -8907,288 +8911,360 @@
 %}
 
 // Float Min Reduction
-instruct rsmin2F_reduction_reg(regF dst, vecD src2, regF tmp) %{
-  predicate(UseSSE > 0 && UseAVX == 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
-  match(Set dst (MinReductionV dst src2));
-  effect(TEMP dst, TEMP tmp);
-  format %{ "minps   $dst, $src2\n\t"
-            "pshufd  $tmp,$src2,0x1\n\t"
-            "minps   $dst,$tmp\t! min reduction2F" %}
-  ins_encode %{
-    __ minps($dst$$XMMRegister, $src2$$XMMRegister);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ minps($dst$$XMMRegister, $tmp$$XMMRegister);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmin2F_reduction_reg(regF dst, vecD src2, regF tmp) %{
+instruct rvmin2F_reduction_reg_av(legRegF dst, legVecD src, legVecD tmp, legVecD dtmp,
+                                  legVecD atmp, legVecD btmp, legVecX xmm_1) %{
   predicate(UseAVX > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
-  match(Set dst (MinReductionV dst src2));
-  effect(TEMP dst, TEMP tmp);
-  format %{ "vminps  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0x1\n\t"
-            "vminps  $dst,$dst,$tmp\t! min reduction2F" %}
-  ins_encode %{
-    int vector_len = 0;
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rsmin4F_reduction_reg(regF dst, vecX src2, regF tmp) %{
-  predicate(UseSSE > 0 && UseAVX == 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
-  match(Set dst (MinReductionV dst src2));
-  effect(TEMP tmp, TEMP dst);
-  format %{ "minps  $dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0x1\n\t"
-            "minps  $dst,tmp\n\t"
-            "pshufd  $tmp,$src2,0x2\n\t"
-            "minps  $dst,tmp\n\t"
-            "pshufd  $tmp,$src2,0x3\n\t"
-            "minps  $dst,$tmp\t! min reduction4F" %}
-  ins_encode %{
-    int vector_len = 0;
-    __ minps($dst$$XMMRegister, $src2$$XMMRegister);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ minps($dst$$XMMRegister, $tmp$$XMMRegister);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x2);
-    __ minps($dst$$XMMRegister, $tmp$$XMMRegister);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x3);
-    __ minps($dst$$XMMRegister, $tmp$$XMMRegister);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmin4F_reduction_reg(regF dst, vecX src2, regF tmp) %{
+  match(Set dst (MinReductionV dst src));
+  effect(TEMP dst, TEMP tmp, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP xmm_1);
+  format %{ "vpermilps    $xmm_1,$src,1\n\t"
+            "vminps_macro $dtmp,$xmm_1,$src\t! minps\n\t"
+            "vminps_macro $dst,$dtmp,$dst\t! minps" %}
+  ins_encode %{
+    int vector_len = 0;
+    __ vpermilps($xmm_1$$XMMRegister, $src$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dtmp$$XMMRegister, $xmm_1$$XMMRegister, $src$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister, true, true, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister, true, true, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmin2F_reduction_reg(legRegF dst, immF src1, legVecD src2, legVecD tmp,
+                               legVecD atmp, legVecD btmp, legVecX xmm_1) %{
+  predicate(UseAVX > 0 && n->in(1)->as_Type()->type() == (Type*)TypeF::POS_INF && 
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
+  match(Set dst (MinReductionV src1 src2));
+  effect(TEMP dst, TEMP tmp, TEMP atmp, TEMP btmp, TEMP xmm_1);
+  format %{ "vpermilps    $xmm_1,$src2,1\n\t"
+            "vminps_macro $dst,$xmm_1,$src2\t! minps" %}
+  ins_encode %{
+    int vector_len = 0;
+    __ vpermilps($xmm_1$$XMMRegister, $src2$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $xmm_1$$XMMRegister, $src2$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister, true, true, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmin4F_reduction_reg_av(legRegF dst, legVecX src, legVecX tmp, legVecX dtmp, 
+                                  legVecX atmp, legVecX btmp, legVecX xmm_0, legVecX xmm_1) %{
   predicate(UseAVX > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
-  match(Set dst (MinReductionV dst src2));
-  effect(TEMP tmp, TEMP dst);
-  format %{ "vminps  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0x1\n\t"
-            "vminps  $dst,$dst,tmp\n\t"
-            "pshufd  $tmp,$src2,0x2\n\t"
-            "vminps  $dst,$dst,tmp\n\t"
-            "pshufd  $tmp,$src2,0x3\n\t"
-            "vminps  $dst,$dst,$tmp\t! min reduction4F" %}
-  ins_encode %{
-    int vector_len = 0;
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x2);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x3);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmin8F_reduction_reg(regF dst, vecY src2, regF tmp, regF tmp2) %{
+  match(Set dst (MinReductionV dst src));
+  effect(TEMP dst, TEMP tmp, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP xmm_0, TEMP xmm_1);
+  format %{ "vpermilps    $xmm_1,$src,14\n\t"
+            "vminps_macro $xmm_0,$xmm_1,$src\t! minps\n\t"
+            "vpermilps    $xmm_1,$xmm_0,1\n\t"
+            "vminps_macro $dtmp,$xmm_1,$xmm_0\t! minps\n\t"
+            "vminps_macro $dst,$dtmp,$dst\t! minps" %}
+  ins_encode %{
+    int vector_len = 0;
+    __ vpermilps($xmm_1$$XMMRegister, $src$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro($xmm_0$$XMMRegister, $xmm_1$$XMMRegister, $src$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vpermilps($xmm_1$$XMMRegister, $xmm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dtmp$$XMMRegister, $xmm_0$$XMMRegister, $xmm_1$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmin4F_reduction_reg(legRegF dst, immF src1, legVecX src2, legVecX tmp, legVecX atmp,
+                               legVecX btmp, legVecX xmm_0, legVecX xmm_1) %{
+  predicate(UseAVX > 0 && n->in(1)->as_Type()->type() == (Type*)TypeF::POS_INF && 
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
+  match(Set dst (MinReductionV src1 src2));
+  effect(TEMP dst, TEMP tmp, TEMP atmp, TEMP btmp, TEMP xmm_0, TEMP xmm_1);
+  format %{ "vpermilps    $xmm_1,$src2,14\n\t"
+            "vminps_macro $xmm_0,$xmm_1,$src2\t! minps\n\t"
+            "vpermilps    $xmm_1,$xmm_0,1\n\t"
+            "vminps_macro $dst,$xmm_1,$xmm_0\t! minps" %}
+  ins_encode %{
+    int vector_len = 0;
+    __ vpermilps($xmm_1$$XMMRegister, $src2$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro($xmm_0$$XMMRegister, $xmm_1$$XMMRegister, $src2$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vpermilps($xmm_1$$XMMRegister, $xmm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $xmm_0$$XMMRegister, $xmm_1$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmin8F_reduction_reg_av(legRegF dst, legVecY src, legVecY tmp, legVecY dtmp, legVecY atmp,
+                                  legVecY btmp, legVecY ymm_0, legVecY ymm_1) %{
   predicate(UseAVX > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
-  match(Set dst (MinReductionV dst src2));
-  effect(TEMP tmp, TEMP dst, TEMP tmp2);
-  format %{ "vminps  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0x01\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$src2,0x02\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$src2,0x03\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "vextractf128_high  $tmp2,$src2\n\t"
-            "vminps  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0x01\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x02\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x03\n\t"
-            "vminps  $dst,$dst,$tmp\t! sub reduction8F" %}
-  ins_encode %{
-    int vector_len = 1;
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x01);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x02);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x03);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf128_high($tmp2$$XMMRegister, $src2$$XMMRegister);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x01);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x02);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x03);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmin16F_reduction_reg(regF dst, vecZ src2, regF tmp, regF tmp2) %{
+  match(Set dst (MinReductionV dst src));
+  effect(TEMP dst, TEMP tmp, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{ "vperm2f128   $ymm_1,$src,$src,1\n\t"
+            "vminps_macro $ymm_0,$ymm_1,$src\t! minps\n\t"
+            "vpermilps    $ymm_1,$ymm_0,14\n\t"
+            "vminps_macro $ymm_0,$ymm_1,$ymm_0\n\t! mips\n\t"
+            "vpermilps    $ymm_1,$ymm_0,1\n\t"
+            "vminps_macro $dtmp,$ymm_1,$ymm_0\t! minps\n\t" 
+            "vminps_macro $dst,$dtmp,$dst\t! minps" %}
+  ins_encode %{
+    int vector_len = 1;
+    __ vperm2f128($ymm_1$$XMMRegister, $src$$XMMRegister, $src$$XMMRegister, 1);
+    __ vmin_max_macro($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $src$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dtmp$$XMMRegister, $ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmin8F_reduction_reg(legRegF dst, immF src1, legVecY src2, legVecY tmp,
+                               legVecY atmp, legVecY btmp, legVecY ymm_0, legVecY ymm_1) %{
+  predicate(UseAVX > 0 && n->in(1)->as_Type()->type() == (Type*)TypeF::POS_INF && 
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
+  match(Set dst (MinReductionV src1 src2));
+  effect(TEMP dst, TEMP tmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{ "vperm2f128   $ymm_1,$src2,$src2, 1\n\t"
+            "vminps_macro $ymm_0,$ymm_1,$src2\t! minps\n\t"
+            "vpermilps    $ymm_1,$ymm_0,14\n\t"
+            "vminps_macro $ymm_0,$ymm_1,$ymm_0\t! mips\n\t"
+            "vpermilps    $ymm_1,$ymm_0,1\n\t"
+            "vminps_macro $dst,$ymm_1,$ymm_0\t! minps" %}
+  ins_encode %{
+    int vector_len = 1;
+    __ vperm2f128($ymm_1$$XMMRegister, $src2$$XMMRegister, $src2$$XMMRegister, 1);
+    __ vmin_max_macro($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $src2$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmin16F_reduction_reg_av(regF dst, vecZ src, vecZ tmp, vecZ dtmp,
+                                   vecZ atmp, vecZ btmp, vecY ymm_0, vecY ymm_1) %{
   predicate(UseAVX > 2 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
-  match(Set dst (MinReductionV dst src2));
-  effect(TEMP tmp, TEMP dst, TEMP tmp2);
-  format %{ "vminps  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0x01\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$src2,0x02\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$src2,0x03\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x1\n\t"
-            "vminps  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0x01\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x02\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x03\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x2\n\t"
-            "vminps  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0x01\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x02\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x03\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x3\n\t"
-            "vminps  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0x01\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x02\n\t"
-            "vminps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x03\n\t"
-            "vminps  $dst,$dst,$tmp\t! sub reduction16F" %}
-  ins_encode %{
-    int vector_len = 2;
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x01);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x02);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x03);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf32x4($tmp2$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x01);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x02);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x03);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf32x4($tmp2$$XMMRegister, $src2$$XMMRegister, 0x2);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x01);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x02);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x03);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf32x4($tmp2$$XMMRegister, $src2$$XMMRegister, 0x3);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x01);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x02);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x03);
-    __ vminps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rsmin2D_reduction_reg(regD dst, vecX src2, regD tmp) %{
-  predicate(UseSSE >= 1 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
-  match(Set dst (MinReductionV dst src2));
-  effect(TEMP tmp, TEMP dst);
-  format %{ "minpd   $dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0xE\n\t"
-            "minpd   $dst,$tmp\t! min reduction2D" %}
-  ins_encode %{
-    __ minpd($dst$$XMMRegister, $src2$$XMMRegister);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0xE);
-    __ minpd($dst$$XMMRegister, $tmp$$XMMRegister);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmin2D_reduction_reg(regD dst, vecX src2, regD tmp) %{
+  match(Set dst (MinReductionV dst src));
+  effect(TEMP dst, TEMP tmp, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{
+       "vextractf64x4 $ymm_0, $src, 0\n\t"
+       "vextractf64x4 $ymm_1, $src, 1\n\t"
+       "vminps_macro $ymm_0,$ymm_1,$ymm_0\t! minps\n\t"
+       "vpermpd      $ymm_1,$ymm_0,78\n\t"
+       "vminps_macro $ymm_0,$ymm_1,$ymm_0\n\t! minps\n\t"
+       "vpermilps    $ymm_1,$ymm_0,14\n\t"
+       "vminps_macro $ymm_0,$ymm_1,$ymm_0\n\t! minps\n\t"
+       "vpermilps    $ymm_1,$ymm_0,1\n\t"
+       "vminps_macro $dtmp,$ymm_1,$ymm_0\t! minps\n\t"
+       "vminps_macro $dst,$dtmp,$dst\t! minps" %}
+  ins_encode %{
+    int vector_len = 1;
+    KRegister ktmp = k1;
+    __ vextractf64x4($ymm_0$$XMMRegister, $src$$XMMRegister, 0);
+    __ vextractf64x4($ymm_1$$XMMRegister, $src$$XMMRegister, 1);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vpermpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 78, vector_len);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro_evex($dtmp$$XMMRegister, $ymm_0$$XMMRegister, $ymm_1$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vmin_max_macro_evex($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmin16F_reduction_reg(regF dst, immF src1, vecZ src2, vecZ tmp,
+                                vecZ atmp, vecZ btmp, vecY ymm_0, vecY ymm_1) %{
+  predicate(UseAVX > 2 && n->in(1)->as_Type()->type() == (Type*)TypeF::POS_INF && 
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
+  match(Set dst (MinReductionV src1 src2));
+  effect(TEMP dst, TEMP tmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{
+       "vextractf64x4 $ymm_0, $src2, 0\n\t"
+       "vextractf64x4 $ymm_1, $src2, 1\n\t"
+       "vminps_macro $ymm_0,$ymm_1,$ymm_0\t! minps\n\t"
+       "vpermpd      $ymm_1,$ymm_0, 78\n\t"
+       "vminps_macro $ymm_0,$ymm_1,$ymm_0\t! minps\n\t"
+       "vpermilps    $ymm_1,$ymm_0,14\n\t"
+       "vminps_macro $ymm_0,$ymm_1,$ymm_0\t! mips\n\t"
+       "vpermilps    $ymm_1,$ymm_0,1\n\t"
+       "vminps_macro $dst,$ymm_1,$ymm_0\t! minps" %}
+  ins_encode %{
+    int vector_len = 1;
+    KRegister ktmp = k1;
+    __ vextractf64x4($ymm_0$$XMMRegister, $src2$$XMMRegister, 0);
+    __ vextractf64x4($ymm_1$$XMMRegister, $src2$$XMMRegister, 1);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vpermpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 78, vector_len);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro_evex($dst$$XMMRegister, $ymm_0$$XMMRegister, $ymm_1$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, true, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmin2D_reduction_reg_av(legRegD dst, legVecX src, legVecX tmp, legVecX dtmp,
+                                  legVecX atmp, legVecX btmp, legVecX xmm_1) %{
   predicate(UseAVX > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
-  match(Set dst (MinReductionV dst src2));
-  effect(TEMP tmp, TEMP dst);
-  format %{ "vminpd  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0xE\n\t"
-            "vminpd  $dst,$dst,$tmp\t! min reduction2D" %}
-  ins_encode %{
-    int vector_len = 0;
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0xE);
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmin4D_reduction_reg(regD dst, vecY src2, regD tmp, regD tmp2) %{
+  match(Set dst (MinReductionV dst src));
+  effect(TEMP dst, TEMP tmp, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP xmm_1);
+  format %{ "vpermilpd    $xmm_1,$src,1\n\t"
+            "vminps_macro $dtmp,$xmm_1,$src\t! minps\n\t"
+            "vminps_macro $dst,$dtmp,$dst\t! minps" %}
+  ins_encode %{
+    int vector_len = 0;
+    __ vpermilpd($xmm_1$$XMMRegister, $src$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dtmp$$XMMRegister, $xmm_1$$XMMRegister, $src$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister, false, true, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister, false, true, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmin2D_reduction_reg(legRegD dst, immD src1, legVecX src2, legVecX tmp,
+                               legVecX atmp, legVecX btmp, legVecX xmm_1) %{
+  predicate(UseAVX > 0 && n->in(1)->as_Type()->type() == (Type*)TypeD::POS_INF && 
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
+  match(Set dst (MinReductionV src1 src2));
+  effect(TEMP dst, TEMP tmp, TEMP atmp, TEMP btmp, TEMP xmm_1);
+  format %{ "vpermilpd    $xmm_1,$src2,1\n\t"
+            "vminps_macro $dst,$xmm_1,$src2\t! minps" %}
+  ins_encode %{
+    int vector_len = 0;
+    __ vpermilpd($xmm_1$$XMMRegister, $src2$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $xmm_1$$XMMRegister, $src2$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister, false, true, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmin4D_reduction_reg_av(legRegD dst, legVecY src, legVecY tmp, legVecY dtmp,
+                                  legVecY atmp, legVecY btmp, legVecY ymm_0, legVecY ymm_1) %{
   predicate(UseAVX > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
-  match(Set dst (MinReductionV dst src2));
-  effect(TEMP tmp, TEMP dst, TEMP tmp2);
-  format %{ "vminpd  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0xE\n\t"
-            "vminpd  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x1\n\t"
-            "vminpd  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0xE\n\t"
-            "vminpd  $dst,$dst,$tmp\t! min reduction4D" %}
-  ins_encode %{
-    int vector_len = 1;
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0xE);
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf128($tmp2$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0xE);
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmin8D_reduction_reg(regD dst, vecZ src2, regD tmp, regD tmp2) %{
+  match(Set dst (MinReductionV dst src));
+  effect(TEMP dst, TEMP tmp, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{ "vperm2f128   $ymm_1,$src,$src,1\n\t"
+            "vminpd_macro $ymm_0,$ymm_1,$src\t! minps\n\t"
+            "vpermilpd    $ymm_1,$ymm_0,1\n\t"
+            "vminpd_macro $dtmp,$ymm_1,$ymm_0\t! minps\n\t"
+            "vminpd_macro $dst,$dtmp,$dst\t! minps" %}
+  ins_encode %{
+    int vector_len = 1;
+    __ vperm2f128($ymm_1$$XMMRegister, $src$$XMMRegister, $src$$XMMRegister, 1);
+    __ vmin_max_macro($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $src$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , false, true, vector_len);
+    __ vpermilpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dtmp$$XMMRegister, $ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , false, true, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , false, true, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmin4D_reduction_reg(legRegD dst, immD src1, legVecY src2, legVecY tmp,
+                               legVecY atmp, legVecY btmp, legVecY ymm_0, legVecY ymm_1) %{
+  predicate(UseAVX > 0  && n->in(1)->as_Type()->type() == (Type*)TypeD::POS_INF && 
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
+  match(Set dst (MinReductionV src1 src2));
+  effect(TEMP dst, TEMP tmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{ "vperm2f128   $ymm_1,$src2,$src2,1\n\t"
+            "vminpd_macro $ymm_0,$ymm_1,$src2\t! minps\n\t"
+            "vpermilpd    $ymm_1,$ymm_0,1\n\t"
+            "vminpd_macro $dst,$ymm_1,$ymm_0\t! minps" %}
+  ins_encode %{
+    int vector_len = 1;
+    __ vperm2f128($ymm_1$$XMMRegister, $src2$$XMMRegister, $src2$$XMMRegister, 1);
+    __ vmin_max_macro($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $src2$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , false, true, vector_len);
+    __ vpermilpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , false, true, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmin8D_reduction_reg_av(regD dst, vecZ src, vecZ tmp, vecZ dtmp, vecZ atmp,
+                                  vecZ btmp, vecY ymm_0, vecY ymm_1) %{
   predicate(UseAVX > 2 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
-  match(Set dst (MinReductionV dst src2));
-  effect(TEMP tmp, TEMP dst, TEMP tmp2);
-  format %{ "vminpd  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0xE\n\t"
-            "vminpd  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x1\n\t"
-            "vminpd  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0xE\n\t"
-            "vminpd  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x2\n\t"
-            "vminpd  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0xE\n\t"
-            "vminpd  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x3\n\t"
-            "vminpd  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0xE\n\t"
-            "vminpd  $dst,$dst,$tmp\t! min reduction8D" %}
-  ins_encode %{
-    int vector_len = 2;
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0xE);
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf32x4($tmp2$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0xE);
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf32x4($tmp2$$XMMRegister, $src2$$XMMRegister, 0x2);
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0xE);
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf32x4($tmp2$$XMMRegister, $src2$$XMMRegister, 0x3);
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0xE);
-    __ vminpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
+  match(Set dst (MinReductionV dst src));
+  effect(TEMP dst, TEMP tmp, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{
+       "vextractf64x4 $ymm_0, $src, 0\n\t"
+       "vextractf64x4 $ymm_1, $src, 1\n\t"
+       "vminpd_macro $ymm_0,$ymm_1,$ymm_0\t! minpd\n\t"
+       "vpermpd      $ymm_1,$ymm_0,14\n\t"
+       "vminpd_macro $ymm_0,$ymm_1,$src\t! minpd\n\t"
+       "vpermilpd    $ymm_1,$ymm_0,1\n\t"
+       "vminpd_macro $dtmp,$ymm_1,$ymm_0\t! minpd\n\t" 
+       "vminpd_macro $dst,$dtmp,$dst\t! minpd\t" %}
+  ins_encode %{
+    int vector_len = 1;
+    KRegister ktmp = k1;
+    __ vextractf64x4($ymm_0$$XMMRegister, $src$$XMMRegister, 0);
+    __ vextractf64x4($ymm_1$$XMMRegister, $src$$XMMRegister, 1);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, true, vector_len);
+    __ vpermpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, true, vector_len);
+    __ vpermilpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro_evex($dst$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, true, vector_len);
+    __ vmin_max_macro_evex($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, true, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmin8D_reduction_reg(regD dst, immD src1, vecZ src2, vecZ tmp, 
+                               vecZ atmp, vecZ btmp, vecY ymm_0, vecY ymm_1) %{
+  predicate(UseAVX > 2 && n->in(1)->as_Type()->type() == (Type*)TypeD::POS_INF && 
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
+  match(Set dst (MinReductionV src1 src2));
+  effect(TEMP dst, TEMP tmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{
+       "vextractf64x4 $ymm_0, $src2, 0\n\t"
+       "vextractf64x4 $ymm_1, $src2, 1\n\t"
+       "vminpd_macro $ymm_0,$ymm_1,$ymm_0\t! minpd\n\t"
+       "vpermpd      $ymm_1,$ymm_0,14\n\t"
+       "vminpd_macro $ymm_0,$ymm_1,$ymm_0\t! minpd\n\t"
+       "vpermilpd    $ymm_1,$ymm_0,1\n\t"
+       "vminpd_macro $dst,$ymm_1,$ymm_0\t! minpd\n\t" %}
+  ins_encode %{
+    int vector_len = 1;
+    KRegister ktmp = k1;
+    __ vextractf64x4($ymm_0$$XMMRegister, $src2$$XMMRegister, 0);
+    __ vextractf64x4($ymm_1$$XMMRegister, $src2$$XMMRegister, 1);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, true, vector_len);
+    __ vpermpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, true, vector_len);
+    __ vpermilpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro_evex($dst$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, true, vector_len);
   %}
   ins_pipe( pipe_slow );
 %}
@@ -10009,290 +10085,360 @@
 %}
 
 // Float max Reduction
-instruct rsmax2F_reduction_reg(regF dst, vecD src2, regF tmp) %{
-  predicate(UseSSE > 0 && UseAVX == 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
-  match(Set dst (MaxReductionV dst src2));
-  effect(TEMP dst, TEMP tmp);
-  format %{ "maxps   $dst, $src2\n\t"
-            "pshufd  $tmp,$src2,0x1\n\t"
-            "maxps   $dst,$tmp\t! max reduction2F" %}
-  ins_encode %{
-    __ maxps($dst$$XMMRegister, $src2$$XMMRegister);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ maxps($dst$$XMMRegister, $tmp$$XMMRegister);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmax2F_reduction_reg(regF dst, vecD src2, regF tmp) %{
+instruct rvmax2F_reduction_reg_av(legRegF dst, legVecD src, legVecD tmp,
+                                  legVecD dtmp, legVecD atmp, legVecD btmp, legVecX xmm_1) %{
   predicate(UseAVX > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
-  match(Set dst (MaxReductionV dst src2));
-  effect(TEMP dst, TEMP tmp);
-  format %{ "vmaxps  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0x1\n\t"
-            "vmaxps  $dst,$dst,$tmp\t! max reduction2F" %}
-  ins_encode %{
-    int vector_len = 0;
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rsmax4F_reduction_reg(regF dst, vecX src2, regF tmp) %{
-  predicate(UseSSE > 0 && UseAVX == 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
-  match(Set dst (MaxReductionV dst src2));
-  effect(TEMP tmp, TEMP dst);
-  format %{ "maxps  $dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0x1\n\t"
-            "maxps  $dst,tmp\n\t"
-            "pshufd  $tmp,$src2,0x2\n\t"
-            "maxps  $dst,tmp\n\t"
-            "pshufd  $tmp,$src2,0x3\n\t"
-            "maxps  $dst,$tmp\t! max reduction4F" %}
-  ins_encode %{
-    __ maxps($dst$$XMMRegister, $src2$$XMMRegister);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ maxps($dst$$XMMRegister, $tmp$$XMMRegister);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x2);
-    __ maxps($dst$$XMMRegister, $tmp$$XMMRegister);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x3);
-    __ maxps($dst$$XMMRegister, $tmp$$XMMRegister);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmax4F_reduction_reg(regF dst, vecX src2, regF tmp) %{
+  match(Set dst (MaxReductionV dst src));
+  effect(TEMP dst, TEMP tmp, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP xmm_1);
+  format %{ "vpermilps    $tmp,$src,1\n\t"
+            "vminps_macro $dtmp,$tmp,$src\t! minps\n\t"
+            "vminps_macro $dst,$dtmp,$dst\t! minps" %}
+  ins_encode %{
+    int vector_len = 0;
+    __ vpermilps($xmm_1$$XMMRegister, $src$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dtmp$$XMMRegister, $xmm_1$$XMMRegister, $src$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister, true, false, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister, true, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmax2F_reduction_reg(legRegF dst, immF src1, legVecD src2, legVecD tmp,
+                               legVecD atmp, legVecD btmp, legVecX xmm_1) %{
+  predicate(UseAVX > 0 && n->in(1)->as_Type()->type() == (Type*)TypeF::NEG_INF && 
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
+  match(Set dst (MaxReductionV src1 src2));
+  effect(TEMP dst, TEMP tmp, TEMP atmp, TEMP btmp, TEMP xmm_1);
+  format %{ "vpermilps    $tmp,$src2,1\n\t"
+            "vminps_macro $dst,$tmp,$src2\t! minps" %}
+  ins_encode %{
+    int vector_len = 0;
+    __ vpermilps($xmm_1$$XMMRegister, $src2$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $xmm_1$$XMMRegister, $src2$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister, true, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmax4F_reduction_reg_av(legRegF dst, legVecX src, legVecX tmp, legVecX dtmp,
+                                  legVecX atmp, legVecX btmp, legVecX xmm_0, legVecX xmm_1) %{
   predicate(UseAVX > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
-  match(Set dst (MaxReductionV dst src2));
-  effect(TEMP tmp, TEMP dst);
-  format %{ "vmaxps  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0x1\n\t"
-            "vmaxps  $dst,$dst,tmp\n\t"
-            "pshufd  $tmp,$src2,0x2\n\t"
-            "vmaxps  $dst,$dst,tmp\n\t"
-            "pshufd  $tmp,$src2,0x3\n\t"
-            "vmaxps  $dst,$dst,$tmp\t! max reduction4F" %}
-  ins_encode %{
-    int vector_len = 0;
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x2);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x3);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmax8F_reduction_reg(regF dst, vecY src2, regF tmp, regF tmp2) %{
+  match(Set dst (MaxReductionV dst src));
+  effect(TEMP dst, TEMP tmp, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP xmm_0, TEMP xmm_1);
+  format %{ "vpermilps    $xmm_1,$src,14\n\t"
+            "vmaxps_macro $xmm_0,$xmm_1,$src\t! maxps\n\t"
+            "vpermilps    $xmm_1,$xmm_0,1\n\t"
+            "vmaxps_macro $dtmp,$xmm_1,$xmm_0\t! maxps\n\t"
+            "vmaxps_macro $dst,$dtmp,$dst\t! maxps" %}
+  ins_encode %{
+    int vector_len = 0;
+    __ vpermilps($xmm_1$$XMMRegister, $src$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro($xmm_0$$XMMRegister, $xmm_1$$XMMRegister, $src$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vpermilps($xmm_1$$XMMRegister, $xmm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dtmp$$XMMRegister, $xmm_0$$XMMRegister, $xmm_1$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmax4F_reduction_reg(legRegF dst, immF src1, legVecX src2, legVecX tmp,
+                               legVecX atmp, legVecX btmp, legVecX xmm_0, legVecX xmm_1) %{
+  predicate(UseAVX > 0 && n->in(1)->as_Type()->type() == (Type*)TypeF::NEG_INF && 
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
+  match(Set dst (MaxReductionV src1 src2));
+  effect(TEMP dst, TEMP tmp, TEMP atmp, TEMP btmp, TEMP xmm_0, TEMP xmm_1);
+  format %{ "vpermilps    $xmm_1,$src2,14\n\t"
+            "vmaxps_macro $xmm_0,$xmm_1,$src2\t! maxps\n\t"
+            "vpermilps    $xmm_1,$xmm_0,1\n\t"
+            "vmaxps_macro $xmm_0,$xmm_1,$xmm_0\t! maxps" %}
+  ins_encode %{
+    int vector_len = 0;
+    __ vpermilps($xmm_1$$XMMRegister, $src2$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro($xmm_0$$XMMRegister, $xmm_1$$XMMRegister, $src2$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vpermilps($xmm_1$$XMMRegister, $xmm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $xmm_0$$XMMRegister, $xmm_1$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmax8F_reduction_reg_av(legRegF dst, legVecY src, legVecY tmp, legVecY dtmp,
+                                  legVecY atmp, legVecY btmp, legVecY ymm_0, legVecY ymm_1) %{
   predicate(UseAVX > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
-  match(Set dst (MaxReductionV dst src2));
-  effect(TEMP tmp, TEMP dst, TEMP tmp2);
-  format %{ "vmaxps  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0x01\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$src2,0x02\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$src2,0x03\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "vextractf128_high  $tmp2,$src2\n\t"
-            "vmaxps  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0x01\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x02\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x03\n\t"
-            "vmaxps  $dst,$dst,$tmp\t! sub reduction8F" %}
-  ins_encode %{
-    int vector_len = 1;
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x01);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x02);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x03);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf128_high($tmp2$$XMMRegister, $src2$$XMMRegister);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x01);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x02);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x03);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmax16F_reduction_reg(regF dst, vecZ src2, regF tmp, regF tmp2) %{
+  match(Set dst (MaxReductionV dst src));
+  effect(TEMP dst, TEMP tmp, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{ "vperm2f128   $ymm_1,$src,$src,1\n\t"
+            "vmaxps_macro $ymm_0,$ymm_1,$src\t! maxps\n\t"
+            "vpermilps    $ymm_1,$ymm_0,14\n\t"
+            "vmaxps_macro $ymm_0,$ymm_1,$ymm_0\t! mips\n\t"
+            "vpermilps    $ymm_1,$ymm_0,1\n\t"
+            "vmaxps_macro $dtmp,$ymm_1,$ymm_0\t! maxps\n\t" 
+            "vmaxps_macro $dst,$dtmp,$dst\t! maxps" %}
+  ins_encode %{
+    int vector_len = 1;
+    __ vperm2f128($ymm_1$$XMMRegister, $src$$XMMRegister, $src$$XMMRegister, 1);
+    __ vmin_max_macro($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $src$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dtmp$$XMMRegister, $ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmax8F_reduction_reg(legRegF dst, immF src1, legVecY src2, legVecY tmp, 
+                               legVecY atmp, legVecY btmp, legVecY ymm_0, legVecY ymm_1) %{
+  predicate(UseAVX > 0 && n->in(1)->as_Type()->type() == (Type*)TypeF::NEG_INF &&
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
+  match(Set dst (MaxReductionV src1 src2));
+  effect(TEMP dst, TEMP tmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{ "vperm2f128   $ymm_1,$src2,$src2,1\n\t"
+            "vmaxps_macro $ymm_0,$ymm_1,$src2\t! maxps\n\t"
+            "vpermilps    $ymm_1,$ymm_0,14\n\t"
+            "vmaxps_macro $ymm_0,$ymm_1,$ymm_0\t! mips\n\t"
+            "vpermilps    $ymm_1,$ymm_0,1\n\t"
+            "vmaxps_macro $dst,$ymm_1,$ymm_0\t! maxps" %}
+  ins_encode %{
+    int vector_len = 1;
+    __ vperm2f128($ymm_1$$XMMRegister, $src2$$XMMRegister, $src2$$XMMRegister, 1);
+    __ vmin_max_macro($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $src2$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmax16F_reduction_reg_av(regF dst, vecZ src, vecZ dtmp, vecZ atmp, vecZ btmp, vecY ymm_0, vecY ymm_1) %{
   predicate(UseAVX > 2 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
-  match(Set dst (MaxReductionV dst src2));
-  effect(TEMP tmp, TEMP dst, TEMP tmp2);
-  format %{ "vmaxps  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0x01\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$src2,0x02\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$src2,0x03\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x1\n\t"
-            "vmaxps  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0x01\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x02\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x03\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x2\n\t"
-            "vmaxps  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0x01\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x02\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x03\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x3\n\t"
-            "vmaxps  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0x01\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x02\n\t"
-            "vmaxps  $dst,$dst,$tmp\n\t"
-            "pshufd  $tmp,$tmp2,0x03\n\t"
-            "vmaxps  $dst,$dst,$tmp\t! sub reduction16F" %}
-  ins_encode %{
-    int vector_len = 2;
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x01);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x02);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x03);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf32x4($tmp2$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x01);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x02);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x03);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf32x4($tmp2$$XMMRegister, $src2$$XMMRegister, 0x2);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x01);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x02);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x03);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf32x4($tmp2$$XMMRegister, $src2$$XMMRegister, 0x3);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x01);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x02);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x03);
-    __ vmaxps($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rsmax2D_reduction_reg(regD dst, vecX src2, regD tmp) %{
-  predicate(UseSSE >= 1 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
-  match(Set dst (MaxReductionV dst src2));
-  effect(TEMP tmp, TEMP dst);
-  format %{ "maxpd   $dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0xE\n\t"
-            "maxpd   $dst,$tmp\t! max reduction2D" %}
-  ins_encode %{
-    __ maxpd($dst$$XMMRegister, $src2$$XMMRegister);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0xE);
-    __ maxpd($dst$$XMMRegister, $tmp$$XMMRegister);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmax2D_reduction_reg(regD dst, vecX src2, regD tmp) %{
+  match(Set dst (MaxReductionV dst src));
+  effect(TEMP dst, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{
+       "vextractf64x4 $ymm_0, $src, 0\n\t"
+       "vextractf64x4 $ymm_1, $src, 1\n\t"
+       "vmaxps_macro $ymm_0,$ymm_1,$ymm_0\t! maxps\n\t"
+       "vpermpd      $ymm_1,$ymm_0, 78\n\t"
+       "vmaxps_macro $ymm_0,$ymm_1,$src\t! maxps\n\t"
+       "vpermilps    $ymm_1,$ymm_0,14\n\t"
+       "vmaxps_macro $ymm_0,$ymm_1,$ymm_0\t! mips\n\t"
+       "vpermilps    $ymm_1,$ymm_0,1\n\t"
+       "vmaxps_macro $dtmp,$ymm_1,$ymm_0\t! maxps\n\t" 
+       "vmaxps_macro $dst,$dtmp,$dst\t! maxps" %}
+  ins_encode %{
+    int vector_len = 1;
+    KRegister  ktmp = k1;
+    __ vextractf64x4($ymm_0$$XMMRegister, $src$$XMMRegister, 0);
+    __ vextractf64x4($ymm_1$$XMMRegister, $src$$XMMRegister, 1);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vpermpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 78, vector_len);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro_evex($dtmp$$XMMRegister, $ymm_0$$XMMRegister, $ymm_1$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vmin_max_macro_evex($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmax16F_reduction_reg(regF dst, immF src1, vecZ src2, vecZ atmp, vecZ btmp, vecY ymm_0, vecY ymm_1) %{
+  predicate(UseAVX > 2 && n->in(1)->as_Type()->type() == (Type*)TypeF::NEG_INF &&
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT);
+  match(Set dst (MaxReductionV src1 src2));
+  effect(TEMP dst, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{
+       "vextractf64x4 $ymm_0, $src2, 0\n\t"
+       "vextractf64x4 $ymm_1, $src2, 1\n\t"
+       "vmaxps_macro $ymm_0,$ymm_1,$ymm_0\t! maxps\n\t"
+       "vpermpd      $ymm_1,$ymm_0, 78\n\t"
+       "vmaxps_macro $ymm_0,$ymm_1,$ymm_0\t! maxps\n\t"
+       "vpermilps    $ymm_1,$ymm_0,14\n\t"
+       "vmaxps_macro $ymm_0,$ymm_1,$ymm_0\t! mips\n\t"
+       "vpermilps    $ymm_1,$ymm_0,1\n\t"
+       "vmaxps_macro $dst,$ymm_1,$ymm_0\t! maxps" %}
+  ins_encode %{
+    int vector_len = 1;
+    KRegister  ktmp = k1;
+    __ vextractf64x4($ymm_0$$XMMRegister, $src2$$XMMRegister, 0);
+    __ vextractf64x4($ymm_1$$XMMRegister, $src2$$XMMRegister, 1);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vpermpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 78, vector_len);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+    __ vpermilps($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro_evex($dst$$XMMRegister, $ymm_0$$XMMRegister, $ymm_1$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , true, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmax2D_reduction_reg_av(legRegD dst, legVecX src, legVecX tmp, legVecX dtmp,
+                                  legVecX atmp, legVecX btmp, legVecX xmm_1) %{
   predicate(UseAVX > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
-  match(Set dst (MaxReductionV dst src2));
-  effect(TEMP tmp, TEMP dst);
-  format %{ "vmaxpd  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0xE\n\t"
-            "vmaxpd  $dst,$dst,$tmp\t! max reduction2D" %}
-  ins_encode %{
-    int vector_len = 0;
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0xE);
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmax4D_reduction_reg(regD dst, vecY src2, regD tmp, regD tmp2) %{
+  match(Set dst (MaxReductionV dst src));
+  effect(TEMP dst, TEMP tmp, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP xmm_1);
+  format %{ "vpermilpd    $xmm_1,$src,1\n\t"
+            "vmaxpd_macro $dtmp,$xmm_1,$src\t! maxps\n\t" 
+            "vmaxpd_macro $dst,$dtmp,$dst\t! maxps" %}
+  ins_encode %{
+    int vector_len = 0;
+    __ vpermilpd($xmm_1$$XMMRegister, $src$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dtmp$$XMMRegister, $xmm_1$$XMMRegister, $src$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister, false, false, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister, false, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmax2D_reduction_reg(legRegD dst, immD src1 , legVecX src2, legVecX tmp,
+                               legVecX atmp, legVecX btmp, legVecX xmm_1) %{
+  predicate(UseAVX > 0 && n->in(1)->as_Type()->type() == (Type*)TypeD::NEG_INF &&
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
+  match(Set dst (MaxReductionV src1 src2));
+  effect(TEMP dst, TEMP tmp, TEMP atmp, TEMP btmp, TEMP xmm_1);
+  format %{ "vpermilpd    $xmm_1,$src2,1\n\t"
+            "vmaxpd_macro $dst,$xmm_1,$src2\t! maxps" %}
+  ins_encode %{
+    int vector_len = 0;
+    __ vpermilpd($xmm_1$$XMMRegister, $src2$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $xmm_1$$XMMRegister, $src2$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister, false, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+instruct rvmax4D_reduction_reg_av(legRegD dst, legVecY src, legVecY tmp, legVecY dtmp, 
+                                  legVecY atmp, legVecY btmp, legVecY ymm_0, legVecY ymm_1) %{
   predicate(UseAVX > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
-  match(Set dst (MaxReductionV dst src2));
-  effect(TEMP tmp, TEMP dst, TEMP tmp2);
-  format %{ "vmaxpd  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0xE\n\t"
-            "vmaxpd  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x1\n\t"
-            "vmaxpd  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0xE\n\t"
-            "vmaxpd  $dst,$dst,$tmp\t! max reduction4D" %}
-  ins_encode %{
-    int vector_len = 1;
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0xE);
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf128($tmp2$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0xE);
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-  %}
-  ins_pipe( pipe_slow );
-%}
-
-instruct rvmax8D_reduction_reg(regD dst, vecZ src2, regD tmp, regD tmp2) %{
+  match(Set dst (MaxReductionV dst src));
+  effect(TEMP dst, TEMP tmp, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{ "vperm2f128   $ymm_1,$src,$src,1\n\t"
+            "vmaxpd_macro $ymm_0,$ymm_1,$src\t! maxps\n\t"
+            "vpermilpd    $ymm_1,$ymm_0,1\n\t"
+            "vmaxpd_macro $dtmp,$ymm_1,$ymm_0\t! maxps\n\t"
+            "vmaxpd_macro $dst,$dtmp,$dst\t! maxps" %}
+  ins_encode %{
+    int vector_len = 1;
+    __ vperm2f128($ymm_1$$XMMRegister, $src$$XMMRegister, $src$$XMMRegister, 1);
+    __ vmin_max_macro($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $src$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , false, false, vector_len);
+    __ vpermilpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dtmp$$XMMRegister, $ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , false, false, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , false, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmax4D_reduction_reg(legRegD dst, immD src1, legVecY src2, legVecY tmp, 
+                               legVecY atmp, legVecY btmp, legVecY ymm_0, legVecY ymm_1) %{
+  predicate(UseAVX > 0 && n->in(1)->as_Type()->type() == (Type*)TypeD::NEG_INF &&
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
+  match(Set dst (MaxReductionV src1 src2));
+  effect(TEMP dst, TEMP tmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{ "vperm2f128   $ymm_1,$src2,$src2,1\n\t"
+            "vmaxpd_macro $ymm_0,$ymm_1,$src2\t! maxps\n\t"
+            "vpermilpd    $ymm_1,$ymm_0,1\n\t"
+            "vmaxpd_macro $ymm_0,$ymm_1,$ymm_0\t! maxps" %}
+  ins_encode %{
+    int vector_len = 1;
+    __ vperm2f128($ymm_1$$XMMRegister, $src2$$XMMRegister, $src2$$XMMRegister, 1);
+    __ vmin_max_macro($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $src2$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , false, false, vector_len);
+    __ vpermilpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro($dst$$XMMRegister, $ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $tmp$$XMMRegister,
+                      $atmp$$XMMRegister, $btmp$$XMMRegister , false, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+instruct rvmax8D_reduction_reg_av(regD dst, vecZ src, vecZ dtmp, vecZ atmp, vecZ btmp, vecY ymm_0, vecY ymm_1) %{
   predicate(UseAVX > 2 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
-  match(Set dst (MaxReductionV dst src2));
-  effect(TEMP tmp, TEMP dst, TEMP tmp2);
-  format %{ "vmaxpd  $dst,$dst,$src2\n\t"
-            "pshufd  $tmp,$src2,0xE\n\t"
-            "vmaxpd  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x1\n\t"
-            "vmaxpd  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0xE\n\t"
-            "vmaxpd  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x2\n\t"
-            "vmaxpd  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0xE\n\t"
-            "vmaxpd  $dst,$dst,$tmp\n\t"
-            "vextractf32x4  $tmp2,$src2,0x3\n\t"
-            "vmaxpd  $dst,$dst,$tmp2\n\t"
-            "pshufd  $tmp,$tmp2,0xE\n\t"
-            "vmaxpd  $dst,$dst,$tmp\t! max reduction8D" %}
-  ins_encode %{
-    int vector_len = 2;
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $src2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0xE);
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf32x4($tmp2$$XMMRegister, $src2$$XMMRegister, 0x1);
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0xE);
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf32x4($tmp2$$XMMRegister, $src2$$XMMRegister, 0x2);
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0xE);
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-    __ vextractf32x4($tmp2$$XMMRegister, $src2$$XMMRegister, 0x3);
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp2$$XMMRegister, vector_len);
-    __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0xE);
-    __ vmaxpd($dst$$XMMRegister, $dst$$XMMRegister, $tmp$$XMMRegister, vector_len);
-  %}
-  ins_pipe( pipe_slow );
-%}
+  match(Set dst (MaxReductionV dst src));
+  effect(TEMP dst, TEMP dtmp, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{
+       "vextractf64x4 $ymm_0, $src, 0\n\t"
+       "vextractf64x4 $ymm_1, $src, 1\n\t"
+       "vmaxpd_macro $ymm_0,$ymm_1,$ymm_0\t! maxpd\n\t"
+       "vpermpd      $ymm_1,$ymm_0, 14\n\t"
+       "vmaxpd_macro $ymm_0,$ymm_1,$ymm_0\t! maxpd\n\t"
+       "vpermilpd    $ymm_1,$ymm_0,1\n\t"
+       "vmaxpd_macro $dtmp,$ymm_1,$ymm_0\t! maxpd\n\t" 
+       "vmaxpd_macro $dst,$dtmp,$dst\t! maxpd\n\t" %} 
+  ins_encode %{
+    int vector_len = 1;
+    KRegister ktmp = k1;
+    __ vextractf64x4($ymm_0$$XMMRegister, $src$$XMMRegister, 0);
+    __ vextractf64x4($ymm_1$$XMMRegister, $src$$XMMRegister, 1);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, false, vector_len);
+    __ vpermpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, false, vector_len);
+    __ vpermilpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro_evex($dtmp$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, false, vector_len);
+    __ vmin_max_macro_evex($dst$$XMMRegister, $dtmp$$XMMRegister, $dst$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
+
+instruct rvmax8D_reduction_reg(regD dst, immD src1, vecZ src2, vecZ atmp, vecZ btmp, vecY ymm_0, vecY ymm_1) %{
+  predicate(UseAVX > 2 && n->in(1)->as_Type()->type() == (Type*)TypeD::NEG_INF &&
+            n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE);
+  match(Set dst (MaxReductionV src1 src2));
+  effect(TEMP dst, TEMP atmp, TEMP btmp, TEMP ymm_0, TEMP ymm_1);
+  format %{
+       "vextractf64x4 $ymm_0, $src2, 0\n\t"
+       "vextractf64x4 $ymm_1, $src2, 1\n\t"
+       "vmaxpd_macro $ymm_0,$ymm_1,$ymm_0\t! maxpd\n\t"
+       "vpermpd      $ymm_1,$ymm_0, 14\n\t"
+       "vmaxpd_macro $ymm_0,$ymm_1,$ymm_0\t! maxpd\n\t"
+       "vpermilpd    $ymm_1,$ymm_0,1\n\t"
+       "vmaxpd_macro $dst,$ymm_1,$ymm_0\t! maxpd\n\t" %} 
+  ins_encode %{
+    int vector_len = 1;
+    KRegister ktmp = k1;
+    __ vextractf64x4($ymm_0$$XMMRegister, $src2$$XMMRegister, 0);
+    __ vextractf64x4($ymm_1$$XMMRegister, $src2$$XMMRegister, 1);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, false, vector_len);
+    __ vpermpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 14, vector_len);
+    __ vmin_max_macro_evex($ymm_0$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, false, vector_len);
+    __ vpermilpd($ymm_1$$XMMRegister, $ymm_0$$XMMRegister, 1, vector_len);
+    __ vmin_max_macro_evex($dst$$XMMRegister, $ymm_1$$XMMRegister, $ymm_0$$XMMRegister, ktmp,
+                    $atmp$$XMMRegister, $btmp$$XMMRegister , false, false, vector_len);
+  %}
+  ins_pipe( pipe_slow );
+%}
+
 
 instruct rsand8B_reduction_reg(rRegI dst, rRegI src1, vecD src2, regF tmp, rRegI tmp2) %{
   predicate(UseSSE > 3 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_BYTE);
--- a/src/hotspot/share/opto/vectornode.cpp	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/hotspot/share/opto/vectornode.cpp	Wed Apr 03 13:12:05 2019 -0700
@@ -969,9 +969,9 @@
         case T_LONG:
           return gvn.makecon(TypeLong::MAX);
         case T_FLOAT:
-          return gvn.makecon(TypeF::MAX);
+          return gvn.makecon(TypeF::POS_INF);
         case T_DOUBLE:
-          return gvn.makecon(TypeD::MAX);
+          return gvn.makecon(TypeD::POS_INF);
           default: Unimplemented(); return NULL;
       }
       break;
@@ -984,9 +984,9 @@
         case T_LONG:
           return gvn.makecon(TypeLong::MIN);
         case T_FLOAT:
-          return gvn.makecon(TypeF::MIN);
+          return gvn.makecon(TypeF::NEG_INF);
         case T_DOUBLE:
-          return gvn.makecon(TypeD::MIN);
+          return gvn.makecon(TypeD::NEG_INF);
           default: Unimplemented(); return NULL;
       }
       break;
--- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -874,7 +874,7 @@
                                 VECTOR_OP_MIN, Double128Vector.class, double.class, LENGTH,
                                 this,
                                 v -> {
-                                    double r = v.rOp(Double.MAX_VALUE , (i, a, b) -> (double) Math.min(a, b));
+                                    double r = v.rOp(Double.POSITIVE_INFINITY , (i, a, b) -> (double) Math.min(a, b));
                                     return (long)Double.doubleToLongBits(r);
                                 });
         return Double.longBitsToDouble(bits);
@@ -887,7 +887,7 @@
                                 VECTOR_OP_MAX, Double128Vector.class, double.class, LENGTH,
                                 this,
                                 v -> {
-                                    double r = v.rOp(Double.MIN_VALUE , (i, a, b) -> (double) Math.max(a, b));
+                                    double r = v.rOp(Double.NEGATIVE_INFINITY, (i, a, b) -> (double) Math.max(a, b));
                                     return (long)Double.doubleToLongBits(r);
                                 });
         return Double.longBitsToDouble(bits);
--- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -874,7 +874,7 @@
                                 VECTOR_OP_MIN, Double256Vector.class, double.class, LENGTH,
                                 this,
                                 v -> {
-                                    double r = v.rOp(Double.MAX_VALUE , (i, a, b) -> (double) Math.min(a, b));
+                                    double r = v.rOp(Double.POSITIVE_INFINITY , (i, a, b) -> (double) Math.min(a, b));
                                     return (long)Double.doubleToLongBits(r);
                                 });
         return Double.longBitsToDouble(bits);
@@ -887,7 +887,7 @@
                                 VECTOR_OP_MAX, Double256Vector.class, double.class, LENGTH,
                                 this,
                                 v -> {
-                                    double r = v.rOp(Double.MIN_VALUE , (i, a, b) -> (double) Math.max(a, b));
+                                    double r = v.rOp(Double.NEGATIVE_INFINITY, (i, a, b) -> (double) Math.max(a, b));
                                     return (long)Double.doubleToLongBits(r);
                                 });
         return Double.longBitsToDouble(bits);
--- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -874,7 +874,7 @@
                                 VECTOR_OP_MIN, Double512Vector.class, double.class, LENGTH,
                                 this,
                                 v -> {
-                                    double r = v.rOp(Double.MAX_VALUE , (i, a, b) -> (double) Math.min(a, b));
+                                    double r = v.rOp(Double.POSITIVE_INFINITY , (i, a, b) -> (double) Math.min(a, b));
                                     return (long)Double.doubleToLongBits(r);
                                 });
         return Double.longBitsToDouble(bits);
@@ -887,7 +887,7 @@
                                 VECTOR_OP_MAX, Double512Vector.class, double.class, LENGTH,
                                 this,
                                 v -> {
-                                    double r = v.rOp(Double.MIN_VALUE , (i, a, b) -> (double) Math.max(a, b));
+                                    double r = v.rOp(Double.NEGATIVE_INFINITY, (i, a, b) -> (double) Math.max(a, b));
                                     return (long)Double.doubleToLongBits(r);
                                 });
         return Double.longBitsToDouble(bits);
--- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -872,7 +872,7 @@
                                 VECTOR_OP_MIN, Double64Vector.class, double.class, LENGTH,
                                 this,
                                 v -> {
-                                    double r = v.rOp(Double.MAX_VALUE , (i, a, b) -> (double) Math.min(a, b));
+                                    double r = v.rOp(Double.POSITIVE_INFINITY , (i, a, b) -> (double) Math.min(a, b));
                                     return (long)Double.doubleToLongBits(r);
                                 });
         return Double.longBitsToDouble(bits);
@@ -885,7 +885,7 @@
                                 VECTOR_OP_MAX, Double64Vector.class, double.class, LENGTH,
                                 this,
                                 v -> {
-                                    double r = v.rOp(Double.MIN_VALUE , (i, a, b) -> (double) Math.max(a, b));
+                                    double r = v.rOp(Double.NEGATIVE_INFINITY, (i, a, b) -> (double) Math.max(a, b));
                                     return (long)Double.doubleToLongBits(r);
                                 });
         return Double.longBitsToDouble(bits);
--- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -874,7 +874,7 @@
                                 VECTOR_OP_MIN, DoubleMaxVector.class, double.class, LENGTH,
                                 this,
                                 v -> {
-                                    double r = v.rOp(Double.MAX_VALUE , (i, a, b) -> (double) Math.min(a, b));
+                                    double r = v.rOp(Double.POSITIVE_INFINITY , (i, a, b) -> (double) Math.min(a, b));
                                     return (long)Double.doubleToLongBits(r);
                                 });
         return Double.longBitsToDouble(bits);
@@ -887,7 +887,7 @@
                                 VECTOR_OP_MAX, DoubleMaxVector.class, double.class, LENGTH,
                                 this,
                                 v -> {
-                                    double r = v.rOp(Double.MIN_VALUE , (i, a, b) -> (double) Math.max(a, b));
+                                    double r = v.rOp(Double.NEGATIVE_INFINITY, (i, a, b) -> (double) Math.max(a, b));
                                     return (long)Double.doubleToLongBits(r);
                                 });
         return Double.longBitsToDouble(bits);
--- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -874,7 +874,7 @@
                                 VECTOR_OP_MIN, Float128Vector.class, float.class, LENGTH,
                                 this,
                                 v -> {
-                                    float r = v.rOp(Float.MAX_VALUE , (i, a, b) -> (float) Math.min(a, b));
+                                    float r = v.rOp(Float.POSITIVE_INFINITY , (i, a, b) -> (float) Math.min(a, b));
                                     return (long)Float.floatToIntBits(r);
                                 });
         return Float.intBitsToFloat(bits);
@@ -887,7 +887,7 @@
                                 VECTOR_OP_MAX, Float128Vector.class, float.class, LENGTH,
                                 this,
                                 v -> {
-                                    float r = v.rOp(Float.MIN_VALUE , (i, a, b) -> (float) Math.max(a, b));
+                                    float r = v.rOp(Float.NEGATIVE_INFINITY, (i, a, b) -> (float) Math.max(a, b));
                                     return (long)Float.floatToIntBits(r);
                                 });
         return Float.intBitsToFloat(bits);
--- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -874,7 +874,7 @@
                                 VECTOR_OP_MIN, Float256Vector.class, float.class, LENGTH,
                                 this,
                                 v -> {
-                                    float r = v.rOp(Float.MAX_VALUE , (i, a, b) -> (float) Math.min(a, b));
+                                    float r = v.rOp(Float.POSITIVE_INFINITY , (i, a, b) -> (float) Math.min(a, b));
                                     return (long)Float.floatToIntBits(r);
                                 });
         return Float.intBitsToFloat(bits);
@@ -887,7 +887,7 @@
                                 VECTOR_OP_MAX, Float256Vector.class, float.class, LENGTH,
                                 this,
                                 v -> {
-                                    float r = v.rOp(Float.MIN_VALUE , (i, a, b) -> (float) Math.max(a, b));
+                                    float r = v.rOp(Float.NEGATIVE_INFINITY, (i, a, b) -> (float) Math.max(a, b));
                                     return (long)Float.floatToIntBits(r);
                                 });
         return Float.intBitsToFloat(bits);
--- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -874,7 +874,7 @@
                                 VECTOR_OP_MIN, Float512Vector.class, float.class, LENGTH,
                                 this,
                                 v -> {
-                                    float r = v.rOp(Float.MAX_VALUE , (i, a, b) -> (float) Math.min(a, b));
+                                    float r = v.rOp(Float.POSITIVE_INFINITY , (i, a, b) -> (float) Math.min(a, b));
                                     return (long)Float.floatToIntBits(r);
                                 });
         return Float.intBitsToFloat(bits);
@@ -887,7 +887,7 @@
                                 VECTOR_OP_MAX, Float512Vector.class, float.class, LENGTH,
                                 this,
                                 v -> {
-                                    float r = v.rOp(Float.MIN_VALUE , (i, a, b) -> (float) Math.max(a, b));
+                                    float r = v.rOp(Float.NEGATIVE_INFINITY, (i, a, b) -> (float) Math.max(a, b));
                                     return (long)Float.floatToIntBits(r);
                                 });
         return Float.intBitsToFloat(bits);
--- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -874,7 +874,7 @@
                                 VECTOR_OP_MIN, Float64Vector.class, float.class, LENGTH,
                                 this,
                                 v -> {
-                                    float r = v.rOp(Float.MAX_VALUE , (i, a, b) -> (float) Math.min(a, b));
+                                    float r = v.rOp(Float.POSITIVE_INFINITY , (i, a, b) -> (float) Math.min(a, b));
                                     return (long)Float.floatToIntBits(r);
                                 });
         return Float.intBitsToFloat(bits);
@@ -887,7 +887,7 @@
                                 VECTOR_OP_MAX, Float64Vector.class, float.class, LENGTH,
                                 this,
                                 v -> {
-                                    float r = v.rOp(Float.MIN_VALUE , (i, a, b) -> (float) Math.max(a, b));
+                                    float r = v.rOp(Float.NEGATIVE_INFINITY, (i, a, b) -> (float) Math.max(a, b));
                                     return (long)Float.floatToIntBits(r);
                                 });
         return Float.intBitsToFloat(bits);
--- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -874,7 +874,7 @@
                                 VECTOR_OP_MIN, FloatMaxVector.class, float.class, LENGTH,
                                 this,
                                 v -> {
-                                    float r = v.rOp(Float.MAX_VALUE , (i, a, b) -> (float) Math.min(a, b));
+                                    float r = v.rOp(Float.POSITIVE_INFINITY , (i, a, b) -> (float) Math.min(a, b));
                                     return (long)Float.floatToIntBits(r);
                                 });
         return Float.intBitsToFloat(bits);
@@ -887,7 +887,7 @@
                                 VECTOR_OP_MAX, FloatMaxVector.class, float.class, LENGTH,
                                 this,
                                 v -> {
-                                    float r = v.rOp(Float.MIN_VALUE , (i, a, b) -> (float) Math.max(a, b));
+                                    float r = v.rOp(Float.NEGATIVE_INFINITY, (i, a, b) -> (float) Math.max(a, b));
                                     return (long)Float.floatToIntBits(r);
                                 });
         return Float.intBitsToFloat(bits);
--- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template	Tue Apr 02 11:13:06 2019 -0700
+++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template	Wed Apr 03 13:12:05 2019 -0700
@@ -1257,7 +1257,7 @@
                                 VECTOR_OP_MIN, $vectortype$.class, $type$.class, LENGTH,
                                 this,
                                 v -> {
-                                    $type$ r = v.rOp($Boxtype$.MAX_VALUE , (i, a, b) -> ($type$) Math.min(a, b));
+                                    $type$ r = v.rOp($Boxtype$.POSITIVE_INFINITY , (i, a, b) -> ($type$) Math.min(a, b));
                                     return (long)$Type$.$type$To$Bitstype$Bits(r);
                                 });
         return $Type$.$bitstype$BitsTo$Fptype$(bits);
@@ -1270,7 +1270,7 @@
                                 VECTOR_OP_MAX, $vectortype$.class, $type$.class, LENGTH,
                                 this,
                                 v -> {
-                                    $type$ r = v.rOp($Boxtype$.MIN_VALUE , (i, a, b) -> ($type$) Math.max(a, b));
+                                    $type$ r = v.rOp($Boxtype$.NEGATIVE_INFINITY, (i, a, b) -> ($type$) Math.max(a, b));
                                     return (long)$Type$.$type$To$Bitstype$Bits(r);
                                 });
         return $Type$.$bitstype$BitsTo$Fptype$(bits);
--- a/test/jdk/jdk/incubator/vector/Double128VectorTests.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/Double128VectorTests.java	Wed Apr 03 13:12:05 2019 -0700
@@ -862,7 +862,7 @@
         assertReductionArraysEquals(a, r, ra, Double128VectorTests::mulAll, Double128VectorTests::mulAll);
     }
     static double minAll(double[] a, int idx) {
-        double res = Double.MAX_VALUE;
+        double res = Double.POSITIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (double)Math.min(res, a[i]);
         }
@@ -871,7 +871,7 @@
     }
 
     static double minAll(double[] a) {
-        double res = Double.MAX_VALUE;
+        double res = Double.POSITIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (double)Math.min(res, a[i]);
         }
@@ -882,7 +882,7 @@
     static void minAllDouble128VectorTests(IntFunction<double[]> fa) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MAX_VALUE;
+        double ra = Double.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -892,7 +892,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MAX_VALUE;
+            ra = Double.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.min(ra, av.minAll());
@@ -902,7 +902,7 @@
         assertReductionArraysEquals(a, r, ra, Double128VectorTests::minAll, Double128VectorTests::minAll);
     }
     static double maxAll(double[] a, int idx) {
-        double res = Double.MIN_VALUE;
+        double res = Double.NEGATIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (double)Math.max(res, a[i]);
         }
@@ -911,7 +911,7 @@
     }
 
     static double maxAll(double[] a) {
-        double res = Double.MIN_VALUE;
+        double res = Double.NEGATIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (double)Math.max(res, a[i]);
         }
@@ -922,7 +922,7 @@
     static void maxAllDouble128VectorTests(IntFunction<double[]> fa) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MIN_VALUE;
+        double ra = Double.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -932,7 +932,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MIN_VALUE;
+            ra = Double.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/Double256VectorTests.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/Double256VectorTests.java	Wed Apr 03 13:12:05 2019 -0700
@@ -862,7 +862,7 @@
         assertReductionArraysEquals(a, r, ra, Double256VectorTests::mulAll, Double256VectorTests::mulAll);
     }
     static double minAll(double[] a, int idx) {
-        double res = Double.MAX_VALUE;
+        double res = Double.POSITIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (double)Math.min(res, a[i]);
         }
@@ -871,7 +871,7 @@
     }
 
     static double minAll(double[] a) {
-        double res = Double.MAX_VALUE;
+        double res = Double.POSITIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (double)Math.min(res, a[i]);
         }
@@ -882,7 +882,7 @@
     static void minAllDouble256VectorTests(IntFunction<double[]> fa) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MAX_VALUE;
+        double ra = Double.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -892,7 +892,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MAX_VALUE;
+            ra = Double.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.min(ra, av.minAll());
@@ -902,7 +902,7 @@
         assertReductionArraysEquals(a, r, ra, Double256VectorTests::minAll, Double256VectorTests::minAll);
     }
     static double maxAll(double[] a, int idx) {
-        double res = Double.MIN_VALUE;
+        double res = Double.NEGATIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (double)Math.max(res, a[i]);
         }
@@ -911,7 +911,7 @@
     }
 
     static double maxAll(double[] a) {
-        double res = Double.MIN_VALUE;
+        double res = Double.NEGATIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (double)Math.max(res, a[i]);
         }
@@ -922,7 +922,7 @@
     static void maxAllDouble256VectorTests(IntFunction<double[]> fa) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MIN_VALUE;
+        double ra = Double.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -932,7 +932,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MIN_VALUE;
+            ra = Double.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/Double512VectorTests.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/Double512VectorTests.java	Wed Apr 03 13:12:05 2019 -0700
@@ -862,7 +862,7 @@
         assertReductionArraysEquals(a, r, ra, Double512VectorTests::mulAll, Double512VectorTests::mulAll);
     }
     static double minAll(double[] a, int idx) {
-        double res = Double.MAX_VALUE;
+        double res = Double.POSITIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (double)Math.min(res, a[i]);
         }
@@ -871,7 +871,7 @@
     }
 
     static double minAll(double[] a) {
-        double res = Double.MAX_VALUE;
+        double res = Double.POSITIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (double)Math.min(res, a[i]);
         }
@@ -882,7 +882,7 @@
     static void minAllDouble512VectorTests(IntFunction<double[]> fa) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MAX_VALUE;
+        double ra = Double.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -892,7 +892,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MAX_VALUE;
+            ra = Double.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.min(ra, av.minAll());
@@ -902,7 +902,7 @@
         assertReductionArraysEquals(a, r, ra, Double512VectorTests::minAll, Double512VectorTests::minAll);
     }
     static double maxAll(double[] a, int idx) {
-        double res = Double.MIN_VALUE;
+        double res = Double.NEGATIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (double)Math.max(res, a[i]);
         }
@@ -911,7 +911,7 @@
     }
 
     static double maxAll(double[] a) {
-        double res = Double.MIN_VALUE;
+        double res = Double.NEGATIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (double)Math.max(res, a[i]);
         }
@@ -922,7 +922,7 @@
     static void maxAllDouble512VectorTests(IntFunction<double[]> fa) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MIN_VALUE;
+        double ra = Double.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -932,7 +932,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MIN_VALUE;
+            ra = Double.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/Double64VectorTests.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/Double64VectorTests.java	Wed Apr 03 13:12:05 2019 -0700
@@ -862,7 +862,7 @@
         assertReductionArraysEquals(a, r, ra, Double64VectorTests::mulAll, Double64VectorTests::mulAll);
     }
     static double minAll(double[] a, int idx) {
-        double res = Double.MAX_VALUE;
+        double res = Double.POSITIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (double)Math.min(res, a[i]);
         }
@@ -871,7 +871,7 @@
     }
 
     static double minAll(double[] a) {
-        double res = Double.MAX_VALUE;
+        double res = Double.POSITIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (double)Math.min(res, a[i]);
         }
@@ -882,7 +882,7 @@
     static void minAllDouble64VectorTests(IntFunction<double[]> fa) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MAX_VALUE;
+        double ra = Double.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -892,7 +892,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MAX_VALUE;
+            ra = Double.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.min(ra, av.minAll());
@@ -902,7 +902,7 @@
         assertReductionArraysEquals(a, r, ra, Double64VectorTests::minAll, Double64VectorTests::minAll);
     }
     static double maxAll(double[] a, int idx) {
-        double res = Double.MIN_VALUE;
+        double res = Double.NEGATIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (double)Math.max(res, a[i]);
         }
@@ -911,7 +911,7 @@
     }
 
     static double maxAll(double[] a) {
-        double res = Double.MIN_VALUE;
+        double res = Double.NEGATIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (double)Math.max(res, a[i]);
         }
@@ -922,7 +922,7 @@
     static void maxAllDouble64VectorTests(IntFunction<double[]> fa) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MIN_VALUE;
+        double ra = Double.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -932,7 +932,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MIN_VALUE;
+            ra = Double.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.java	Wed Apr 03 13:12:05 2019 -0700
@@ -868,7 +868,7 @@
         assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::mulAll, DoubleMaxVectorTests::mulAll);
     }
     static double minAll(double[] a, int idx) {
-        double res = Double.MAX_VALUE;
+        double res = Double.POSITIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (double)Math.min(res, a[i]);
         }
@@ -877,7 +877,7 @@
     }
 
     static double minAll(double[] a) {
-        double res = Double.MAX_VALUE;
+        double res = Double.POSITIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (double)Math.min(res, a[i]);
         }
@@ -888,7 +888,7 @@
     static void minAllDoubleMaxVectorTests(IntFunction<double[]> fa) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MAX_VALUE;
+        double ra = Double.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -898,7 +898,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MAX_VALUE;
+            ra = Double.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.min(ra, av.minAll());
@@ -908,7 +908,7 @@
         assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::minAll, DoubleMaxVectorTests::minAll);
     }
     static double maxAll(double[] a, int idx) {
-        double res = Double.MIN_VALUE;
+        double res = Double.NEGATIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (double)Math.max(res, a[i]);
         }
@@ -917,7 +917,7 @@
     }
 
     static double maxAll(double[] a) {
-        double res = Double.MIN_VALUE;
+        double res = Double.NEGATIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (double)Math.max(res, a[i]);
         }
@@ -928,7 +928,7 @@
     static void maxAllDoubleMaxVectorTests(IntFunction<double[]> fa) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MIN_VALUE;
+        double ra = Double.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -938,7 +938,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MIN_VALUE;
+            ra = Double.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/Float128VectorTests.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/Float128VectorTests.java	Wed Apr 03 13:12:05 2019 -0700
@@ -862,7 +862,7 @@
         assertReductionArraysEquals(a, r, ra, Float128VectorTests::mulAll, Float128VectorTests::mulAll);
     }
     static float minAll(float[] a, int idx) {
-        float res = Float.MAX_VALUE;
+        float res = Float.POSITIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (float)Math.min(res, a[i]);
         }
@@ -871,7 +871,7 @@
     }
 
     static float minAll(float[] a) {
-        float res = Float.MAX_VALUE;
+        float res = Float.POSITIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (float)Math.min(res, a[i]);
         }
@@ -882,7 +882,7 @@
     static void minAllFloat128VectorTests(IntFunction<float[]> fa) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MAX_VALUE;
+        float ra = Float.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -892,7 +892,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MAX_VALUE;
+            ra = Float.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.min(ra, av.minAll());
@@ -902,7 +902,7 @@
         assertReductionArraysEquals(a, r, ra, Float128VectorTests::minAll, Float128VectorTests::minAll);
     }
     static float maxAll(float[] a, int idx) {
-        float res = Float.MIN_VALUE;
+        float res = Float.NEGATIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (float)Math.max(res, a[i]);
         }
@@ -911,7 +911,7 @@
     }
 
     static float maxAll(float[] a) {
-        float res = Float.MIN_VALUE;
+        float res = Float.NEGATIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (float)Math.max(res, a[i]);
         }
@@ -922,7 +922,7 @@
     static void maxAllFloat128VectorTests(IntFunction<float[]> fa) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MIN_VALUE;
+        float ra = Float.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -932,7 +932,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MIN_VALUE;
+            ra = Float.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/Float256VectorTests.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/Float256VectorTests.java	Wed Apr 03 13:12:05 2019 -0700
@@ -862,7 +862,7 @@
         assertReductionArraysEquals(a, r, ra, Float256VectorTests::mulAll, Float256VectorTests::mulAll);
     }
     static float minAll(float[] a, int idx) {
-        float res = Float.MAX_VALUE;
+        float res = Float.POSITIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (float)Math.min(res, a[i]);
         }
@@ -871,7 +871,7 @@
     }
 
     static float minAll(float[] a) {
-        float res = Float.MAX_VALUE;
+        float res = Float.POSITIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (float)Math.min(res, a[i]);
         }
@@ -882,7 +882,7 @@
     static void minAllFloat256VectorTests(IntFunction<float[]> fa) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MAX_VALUE;
+        float ra = Float.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -892,7 +892,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MAX_VALUE;
+            ra = Float.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.min(ra, av.minAll());
@@ -902,7 +902,7 @@
         assertReductionArraysEquals(a, r, ra, Float256VectorTests::minAll, Float256VectorTests::minAll);
     }
     static float maxAll(float[] a, int idx) {
-        float res = Float.MIN_VALUE;
+        float res = Float.NEGATIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (float)Math.max(res, a[i]);
         }
@@ -911,7 +911,7 @@
     }
 
     static float maxAll(float[] a) {
-        float res = Float.MIN_VALUE;
+        float res = Float.NEGATIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (float)Math.max(res, a[i]);
         }
@@ -922,7 +922,7 @@
     static void maxAllFloat256VectorTests(IntFunction<float[]> fa) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MIN_VALUE;
+        float ra = Float.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -932,7 +932,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MIN_VALUE;
+            ra = Float.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/Float512VectorTests.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/Float512VectorTests.java	Wed Apr 03 13:12:05 2019 -0700
@@ -862,7 +862,7 @@
         assertReductionArraysEquals(a, r, ra, Float512VectorTests::mulAll, Float512VectorTests::mulAll);
     }
     static float minAll(float[] a, int idx) {
-        float res = Float.MAX_VALUE;
+        float res = Float.POSITIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (float)Math.min(res, a[i]);
         }
@@ -871,7 +871,7 @@
     }
 
     static float minAll(float[] a) {
-        float res = Float.MAX_VALUE;
+        float res = Float.POSITIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (float)Math.min(res, a[i]);
         }
@@ -882,7 +882,7 @@
     static void minAllFloat512VectorTests(IntFunction<float[]> fa) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MAX_VALUE;
+        float ra = Float.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -892,7 +892,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MAX_VALUE;
+            ra = Float.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.min(ra, av.minAll());
@@ -902,7 +902,7 @@
         assertReductionArraysEquals(a, r, ra, Float512VectorTests::minAll, Float512VectorTests::minAll);
     }
     static float maxAll(float[] a, int idx) {
-        float res = Float.MIN_VALUE;
+        float res = Float.NEGATIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (float)Math.max(res, a[i]);
         }
@@ -911,7 +911,7 @@
     }
 
     static float maxAll(float[] a) {
-        float res = Float.MIN_VALUE;
+        float res = Float.NEGATIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (float)Math.max(res, a[i]);
         }
@@ -922,7 +922,7 @@
     static void maxAllFloat512VectorTests(IntFunction<float[]> fa) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MIN_VALUE;
+        float ra = Float.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -932,7 +932,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MIN_VALUE;
+            ra = Float.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/Float64VectorTests.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/Float64VectorTests.java	Wed Apr 03 13:12:05 2019 -0700
@@ -862,7 +862,7 @@
         assertReductionArraysEquals(a, r, ra, Float64VectorTests::mulAll, Float64VectorTests::mulAll);
     }
     static float minAll(float[] a, int idx) {
-        float res = Float.MAX_VALUE;
+        float res = Float.POSITIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (float)Math.min(res, a[i]);
         }
@@ -871,7 +871,7 @@
     }
 
     static float minAll(float[] a) {
-        float res = Float.MAX_VALUE;
+        float res = Float.POSITIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (float)Math.min(res, a[i]);
         }
@@ -882,7 +882,7 @@
     static void minAllFloat64VectorTests(IntFunction<float[]> fa) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MAX_VALUE;
+        float ra = Float.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -892,7 +892,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MAX_VALUE;
+            ra = Float.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.min(ra, av.minAll());
@@ -902,7 +902,7 @@
         assertReductionArraysEquals(a, r, ra, Float64VectorTests::minAll, Float64VectorTests::minAll);
     }
     static float maxAll(float[] a, int idx) {
-        float res = Float.MIN_VALUE;
+        float res = Float.NEGATIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (float)Math.max(res, a[i]);
         }
@@ -911,7 +911,7 @@
     }
 
     static float maxAll(float[] a) {
-        float res = Float.MIN_VALUE;
+        float res = Float.NEGATIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (float)Math.max(res, a[i]);
         }
@@ -922,7 +922,7 @@
     static void maxAllFloat64VectorTests(IntFunction<float[]> fa) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MIN_VALUE;
+        float ra = Float.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -932,7 +932,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MIN_VALUE;
+            ra = Float.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/FloatMaxVectorTests.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/FloatMaxVectorTests.java	Wed Apr 03 13:12:05 2019 -0700
@@ -868,7 +868,7 @@
         assertReductionArraysEquals(a, r, ra, FloatMaxVectorTests::mulAll, FloatMaxVectorTests::mulAll);
     }
     static float minAll(float[] a, int idx) {
-        float res = Float.MAX_VALUE;
+        float res = Float.POSITIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (float)Math.min(res, a[i]);
         }
@@ -877,7 +877,7 @@
     }
 
     static float minAll(float[] a) {
-        float res = Float.MAX_VALUE;
+        float res = Float.POSITIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (float)Math.min(res, a[i]);
         }
@@ -888,7 +888,7 @@
     static void minAllFloatMaxVectorTests(IntFunction<float[]> fa) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MAX_VALUE;
+        float ra = Float.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -898,7 +898,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MAX_VALUE;
+            ra = Float.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.min(ra, av.minAll());
@@ -908,7 +908,7 @@
         assertReductionArraysEquals(a, r, ra, FloatMaxVectorTests::minAll, FloatMaxVectorTests::minAll);
     }
     static float maxAll(float[] a, int idx) {
-        float res = Float.MIN_VALUE;
+        float res = Float.NEGATIVE_INFINITY;
         for (int i = idx; i < (idx + SPECIES.length()); i++) {
             res = (float)Math.max(res, a[i]);
         }
@@ -917,7 +917,7 @@
     }
 
     static float maxAll(float[] a) {
-        float res = Float.MIN_VALUE;
+        float res = Float.NEGATIVE_INFINITY;
         for (int i = 0; i < a.length; i++) {
             res = (float)Math.max(res, a[i]);
         }
@@ -928,7 +928,7 @@
     static void maxAllFloatMaxVectorTests(IntFunction<float[]> fa) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MIN_VALUE;
+        float ra = Float.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -938,7 +938,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MIN_VALUE;
+            ra = Float.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double128Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double128Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -353,7 +353,7 @@
     public void minAll(Blackhole bh) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MAX_VALUE;
+        double ra = Double.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -363,7 +363,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MAX_VALUE;
+            ra = Double.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.min(ra, av.minAll());
@@ -378,7 +378,7 @@
     public void maxAll(Blackhole bh) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MIN_VALUE;
+        double ra = Double.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -388,7 +388,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MIN_VALUE;
+            ra = Double.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double256Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double256Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -353,7 +353,7 @@
     public void minAll(Blackhole bh) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MAX_VALUE;
+        double ra = Double.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -363,7 +363,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MAX_VALUE;
+            ra = Double.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.min(ra, av.minAll());
@@ -378,7 +378,7 @@
     public void maxAll(Blackhole bh) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MIN_VALUE;
+        double ra = Double.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -388,7 +388,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MIN_VALUE;
+            ra = Double.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double512Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double512Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -353,7 +353,7 @@
     public void minAll(Blackhole bh) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MAX_VALUE;
+        double ra = Double.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -363,7 +363,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MAX_VALUE;
+            ra = Double.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.min(ra, av.minAll());
@@ -378,7 +378,7 @@
     public void maxAll(Blackhole bh) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MIN_VALUE;
+        double ra = Double.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -388,7 +388,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MIN_VALUE;
+            ra = Double.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double64Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double64Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -353,7 +353,7 @@
     public void minAll(Blackhole bh) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MAX_VALUE;
+        double ra = Double.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -363,7 +363,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MAX_VALUE;
+            ra = Double.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.min(ra, av.minAll());
@@ -378,7 +378,7 @@
     public void maxAll(Blackhole bh) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MIN_VALUE;
+        double ra = Double.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -388,7 +388,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MIN_VALUE;
+            ra = Double.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/DoubleMaxVector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/DoubleMaxVector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -353,7 +353,7 @@
     public void minAll(Blackhole bh) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MAX_VALUE;
+        double ra = Double.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -363,7 +363,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MAX_VALUE;
+            ra = Double.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.min(ra, av.minAll());
@@ -378,7 +378,7 @@
     public void maxAll(Blackhole bh) {
         double[] a = fa.apply(SPECIES.length());
         double[] r = fr.apply(SPECIES.length());
-        double ra = Double.MIN_VALUE;
+        double ra = Double.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -388,7 +388,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Double.MIN_VALUE;
+            ra = Double.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
                 ra = (double)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/DoubleScalar.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/DoubleScalar.java	Wed Apr 03 13:12:05 2019 -0700
@@ -297,7 +297,7 @@
     @Benchmark
     public double minAll() {
         double[] as = fa.apply(size);
-        double r = Double.MAX_VALUE;
+        double r = Double.POSITIVE_INFINITY;
         for (int i = 0; i < as.length; i++) {
             r = (double)Math.min(r, as[i]);
         }
@@ -307,7 +307,7 @@
     @Benchmark
     public double maxAll() {
         double[] as = fa.apply(size);
-        double r = Double.MIN_VALUE;
+        double r = Double.NEGATIVE_INFINITY;
         for (int i = 0; i < as.length; i++) {
             r = (double)Math.max(r, as[i]);
         }
--- a/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float128Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float128Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -353,7 +353,7 @@
     public void minAll(Blackhole bh) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MAX_VALUE;
+        float ra = Float.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -363,7 +363,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MAX_VALUE;
+            ra = Float.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.min(ra, av.minAll());
@@ -378,7 +378,7 @@
     public void maxAll(Blackhole bh) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MIN_VALUE;
+        float ra = Float.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -388,7 +388,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MIN_VALUE;
+            ra = Float.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float256Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float256Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -353,7 +353,7 @@
     public void minAll(Blackhole bh) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MAX_VALUE;
+        float ra = Float.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -363,7 +363,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MAX_VALUE;
+            ra = Float.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.min(ra, av.minAll());
@@ -378,7 +378,7 @@
     public void maxAll(Blackhole bh) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MIN_VALUE;
+        float ra = Float.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -388,7 +388,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MIN_VALUE;
+            ra = Float.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float512Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float512Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -353,7 +353,7 @@
     public void minAll(Blackhole bh) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MAX_VALUE;
+        float ra = Float.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -363,7 +363,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MAX_VALUE;
+            ra = Float.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.min(ra, av.minAll());
@@ -378,7 +378,7 @@
     public void maxAll(Blackhole bh) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MIN_VALUE;
+        float ra = Float.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -388,7 +388,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MIN_VALUE;
+            ra = Float.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float64Vector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float64Vector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -353,7 +353,7 @@
     public void minAll(Blackhole bh) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MAX_VALUE;
+        float ra = Float.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -363,7 +363,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MAX_VALUE;
+            ra = Float.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.min(ra, av.minAll());
@@ -378,7 +378,7 @@
     public void maxAll(Blackhole bh) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MIN_VALUE;
+        float ra = Float.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -388,7 +388,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MIN_VALUE;
+            ra = Float.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/FloatMaxVector.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/FloatMaxVector.java	Wed Apr 03 13:12:05 2019 -0700
@@ -353,7 +353,7 @@
     public void minAll(Blackhole bh) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MAX_VALUE;
+        float ra = Float.POSITIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -363,7 +363,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MAX_VALUE;
+            ra = Float.POSITIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.min(ra, av.minAll());
@@ -378,7 +378,7 @@
     public void maxAll(Blackhole bh) {
         float[] a = fa.apply(SPECIES.length());
         float[] r = fr.apply(SPECIES.length());
-        float ra = Float.MIN_VALUE;
+        float ra = Float.NEGATIVE_INFINITY;
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
             for (int i = 0; i < a.length; i += SPECIES.length()) {
@@ -388,7 +388,7 @@
         }
 
         for (int ic = 0; ic < INVOC_COUNT; ic++) {
-            ra = Float.MIN_VALUE;
+            ra = Float.NEGATIVE_INFINITY;
             for (int i = 0; i < a.length; i += SPECIES.length()) {
                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
                 ra = (float)Math.max(ra, av.maxAll());
--- a/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/FloatScalar.java	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/FloatScalar.java	Wed Apr 03 13:12:05 2019 -0700
@@ -297,7 +297,7 @@
     @Benchmark
     public float minAll() {
         float[] as = fa.apply(size);
-        float r = Float.MAX_VALUE;
+        float r = Float.POSITIVE_INFINITY;
         for (int i = 0; i < as.length; i++) {
             r = (float)Math.min(r, as[i]);
         }
@@ -307,7 +307,7 @@
     @Benchmark
     public float maxAll() {
         float[] as = fa.apply(size);
-        float r = Float.MIN_VALUE;
+        float r = Float.NEGATIVE_INFINITY;
         for (int i = 0; i < as.length; i++) {
             r = (float)Math.max(r, as[i]);
         }
--- a/test/jdk/jdk/incubator/vector/gen-template.sh	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/gen-template.sh	Wed Apr 03 13:12:05 2019 -0700
@@ -280,8 +280,9 @@
 gen_reduction_op "xorAll" "^" $unit_output $perf_output $perf_scalar_output "BITWISE" "0"
 gen_reduction_op "addAll" "+" $unit_output $perf_output $perf_scalar_output "" "0"
 gen_reduction_op "mulAll" "*" $unit_output $perf_output $perf_scalar_output "" "1"
-gen_reduction_op_min "minAll" "" $unit_output $perf_output $perf_scalar_output "" "\$Wideboxtype\$.MAX_VALUE"
-gen_reduction_op_max "maxAll" "" $unit_output $perf_output $perf_scalar_output "" "\$Wideboxtype\$.MIN_VALUE"
+gen_reduction_op_min "minAll" "" $unit_output $perf_output $perf_scalar_output "" "\$Wideboxtype\$.\$MaxValue\$"
+gen_reduction_op_max "maxAll" "" $unit_output $perf_output $perf_scalar_output "" "\$Wideboxtype\$.\$MinValue\$"
+
 
 # Boolean reductions.
 gen_bool_reduction_op "anyTrue" "|" $unit_output $perf_output $perf_scalar_output "BITWISE" "false"
--- a/test/jdk/jdk/incubator/vector/gen-tests.sh	Tue Apr 02 11:13:06 2019 -0700
+++ b/test/jdk/jdk/incubator/vector/gen-tests.sh	Wed Apr 03 13:12:05 2019 -0700
@@ -46,6 +46,8 @@
 
   Boxtype=$Type
   Wideboxtype=$Boxtype
+  MaxValue=MAX_VALUE
+  MinValue=MIN_VALUE
 
   kind=BITWISE
 
@@ -86,16 +88,22 @@
       bitstype=int
       Bitstype=Int
       Boxbitstype=Integer
+      Wideboxtype=Float
+      MaxValue=POSITIVE_INFINITY
+      MinValue=NEGATIVE_INFINITY
       ;;
     double)
       kind=FP
       bitstype=long
       Bitstype=Long
       Boxbitstype=Long
+      Wideboxtype=Double
+      MaxValue=POSITIVE_INFINITY
+      MinValue=NEGATIVE_INFINITY
       ;;
   esac
 
-  args="$args -K$kind -K$Type -DBoxtype=$Boxtype -DWideboxtype=$Wideboxtype"
+  args="$args -K$kind -K$Type -DBoxtype=$Boxtype -DWideboxtype=$Wideboxtype -DMaxValue=$MaxValue -DMinValue=$MinValue"
   args="$args -Dbitstype=$bitstype -DBitstype=$Bitstype -DBoxbitstype=$Boxbitstype"
   args="$args -Dfptype=$fptype -DFptype=$Fptype -DBoxfptype=$Boxfptype"