Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit 40c1013

Browse files
mo-beckluhenry
authored and
Thomas Schatzl
committedJul 24, 2020
8248668: AArch64: Avoid MIN/MAX macros when using MSVC
MSVC employs min/max as macros Co-authored-by: Ludovic Henry <luhenry@microsoft.com> Reviewed-by: tschatzl, kbarrett
1 parent eb448c2 commit 40c1013

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed
 

‎src/hotspot/cpu/aarch64/aarch64.ad

+1-1
Original file line numberDiff line numberDiff line change
@@ -10150,7 +10150,7 @@ instruct lshift_ext(iRegLNoSp dst, iRegIorL2I src, immI scale, rFlagsReg cr) %{
1015010150
ins_encode %{
1015110151
__ sbfiz(as_Register($dst$$reg),
1015210152
as_Register($src$$reg),
10153-
$scale$$constant & 63, MIN(32, (-$scale$$constant) & 63));
10153+
$scale$$constant & 63, MIN2(32, (int)((-$scale$$constant) & 63)));
1015410154
%}
1015510155

1015610156
ins_pipe(ialu_reg_shift);

‎src/hotspot/cpu/aarch64/assembler_aarch64.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ void Address::lea(MacroAssembler *as, Register r) const {
15171517
break;
15181518
}
15191519
case base_plus_offset_reg: {
1520-
__ add(r, _base, _index, _ext.op(), MAX(_ext.shift(), 0));
1520+
__ add(r, _base, _index, _ext.op(), MAX2(_ext.shift(), 0));
15211521
break;
15221522
}
15231523
case literal: {

‎src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -4060,7 +4060,7 @@ class StubGenerator: public StubCodeGenerator {
40604060
FloatRegister vtmpZ = v0, vtmp = v1, vtmp3 = v2;
40614061
RegSet spilled_regs = RegSet::of(tmp3, tmp4);
40624062

4063-
int prefetchLoopExitCondition = MAX(64, SoftwarePrefetchHintDistance/2);
4063+
int prefetchLoopExitCondition = MAX2(64, SoftwarePrefetchHintDistance/2);
40644064

40654065
__ eor(vtmpZ, __ T16B, vtmpZ, vtmpZ);
40664066
// cnt2 == amount of characters left to compare
@@ -4218,7 +4218,7 @@ class StubGenerator: public StubCodeGenerator {
42184218
DIFF_LAST_POSITION, DIFF_LAST_POSITION2;
42194219
// exit from large loop when less than 64 bytes left to read or we're about
42204220
// to prefetch memory behind array border
4221-
int largeLoopExitCondition = MAX(64, SoftwarePrefetchHintDistance)/(isLL ? 1 : 2);
4221+
int largeLoopExitCondition = MAX2(64, SoftwarePrefetchHintDistance)/(isLL ? 1 : 2);
42224222
// cnt1/cnt2 contains amount of characters to compare. cnt1 can be re-used
42234223
// update cnt2 counter with already loaded 8 bytes
42244224
__ sub(cnt2, cnt2, wordSize/(isLL ? 1 : 2));
@@ -4644,7 +4644,7 @@ class StubGenerator: public StubCodeGenerator {
46444644
address entry = __ pc();
46454645
Label LOOP, LOOP_START, LOOP_PRFM, LOOP_PRFM_START, DONE;
46464646
Register src = r0, dst = r1, len = r2, octetCounter = r3;
4647-
const int large_loop_threshold = MAX(64, SoftwarePrefetchHintDistance)/8 + 4;
4647+
const int large_loop_threshold = MAX2(64, SoftwarePrefetchHintDistance)/8 + 4;
46484648

46494649
// do one more 8-byte read to have address 16-byte aligned in most cases
46504650
// also use single store instruction

0 commit comments

Comments
 (0)