changeset 60298:8b8111739fed

8248668: AArch64: Avoid MIN/MAX macros when using MSVC Summary: MSVC employs min/max as macros Reviewed-by: tschatzl, kbarrett Contributed-by: monica.beckwith@microsoft.com, luhenry@microsoft.com
author tschatzl
date Fri, 24 Jul 2020 11:16:08 +0200
parents 0f77d2b07026
children 7f4d7d34b92d
files src/hotspot/cpu/aarch64/aarch64.ad src/hotspot/cpu/aarch64/assembler_aarch64.cpp src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp
diffstat 3 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/cpu/aarch64/aarch64.ad	Fri Jul 24 11:16:05 2020 +0200
+++ b/src/hotspot/cpu/aarch64/aarch64.ad	Fri Jul 24 11:16:08 2020 +0200
@@ -10150,7 +10150,7 @@
   ins_encode %{
     __ sbfiz(as_Register($dst$$reg),
           as_Register($src$$reg),
-          $scale$$constant & 63, MIN(32, (-$scale$$constant) & 63));
+          $scale$$constant & 63, MIN2(32, (int)((-$scale$$constant) & 63)));
   %}
 
   ins_pipe(ialu_reg_shift);
--- a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp	Fri Jul 24 11:16:05 2020 +0200
+++ b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp	Fri Jul 24 11:16:08 2020 +0200
@@ -1517,7 +1517,7 @@
       break;
   }
   case base_plus_offset_reg: {
-    __ add(r, _base, _index, _ext.op(), MAX(_ext.shift(), 0));
+    __ add(r, _base, _index, _ext.op(), MAX2(_ext.shift(), 0));
     break;
   }
   case literal: {
--- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp	Fri Jul 24 11:16:05 2020 +0200
+++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp	Fri Jul 24 11:16:08 2020 +0200
@@ -4060,7 +4060,7 @@
     FloatRegister vtmpZ = v0, vtmp = v1, vtmp3 = v2;
     RegSet spilled_regs = RegSet::of(tmp3, tmp4);
 
-    int prefetchLoopExitCondition = MAX(64, SoftwarePrefetchHintDistance/2);
+    int prefetchLoopExitCondition = MAX2(64, SoftwarePrefetchHintDistance/2);
 
     __ eor(vtmpZ, __ T16B, vtmpZ, vtmpZ);
     // cnt2 == amount of characters left to compare
@@ -4218,7 +4218,7 @@
         DIFF_LAST_POSITION, DIFF_LAST_POSITION2;
     // exit from large loop when less than 64 bytes left to read or we're about
     // to prefetch memory behind array border
-    int largeLoopExitCondition = MAX(64, SoftwarePrefetchHintDistance)/(isLL ? 1 : 2);
+    int largeLoopExitCondition = MAX2(64, SoftwarePrefetchHintDistance)/(isLL ? 1 : 2);
     // cnt1/cnt2 contains amount of characters to compare. cnt1 can be re-used
     // update cnt2 counter with already loaded 8 bytes
     __ sub(cnt2, cnt2, wordSize/(isLL ? 1 : 2));
@@ -4644,7 +4644,7 @@
     address entry = __ pc();
     Label LOOP, LOOP_START, LOOP_PRFM, LOOP_PRFM_START, DONE;
     Register src = r0, dst = r1, len = r2, octetCounter = r3;
-    const int large_loop_threshold = MAX(64, SoftwarePrefetchHintDistance)/8 + 4;
+    const int large_loop_threshold = MAX2(64, SoftwarePrefetchHintDistance)/8 + 4;
 
     // do one more 8-byte read to have address 16-byte aligned in most cases
     // also use single store instruction