Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.
/ jdk22 Public archive

Commit b0920c2

Browse files
author
Sandhya Viswanathan
committedJan 12, 2024
8321712: C2: "failed: Multiple uses of register" in C2_MacroAssembler::vminmax_fp
Reviewed-by: kvn, thartmann Backport-of: e10d14004fa25998231ab1d2611b75aea9b5c67d
1 parent 3909d74 commit b0920c2

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed
 

‎src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,8 @@ void C2_MacroAssembler::vminmax_fp(int opcode, BasicType elem_bt,
10891089
assert(opcode == Op_MinV || opcode == Op_MinReductionV ||
10901090
opcode == Op_MaxV || opcode == Op_MaxReductionV, "sanity");
10911091
assert(elem_bt == T_FLOAT || elem_bt == T_DOUBLE, "sanity");
1092-
assert_different_registers(a, b, tmp, atmp, btmp);
1092+
assert_different_registers(a, tmp, atmp, btmp);
1093+
assert_different_registers(b, tmp, atmp, btmp);
10931094

10941095
bool is_min = (opcode == Op_MinV || opcode == Op_MinReductionV);
10951096
bool is_double_word = is_double_word_type(elem_bt);
@@ -1176,7 +1177,8 @@ void C2_MacroAssembler::evminmax_fp(int opcode, BasicType elem_bt,
11761177
assert(opcode == Op_MinV || opcode == Op_MinReductionV ||
11771178
opcode == Op_MaxV || opcode == Op_MaxReductionV, "sanity");
11781179
assert(elem_bt == T_FLOAT || elem_bt == T_DOUBLE, "sanity");
1179-
assert_different_registers(dst, a, b, atmp, btmp);
1180+
assert_different_registers(dst, a, atmp, btmp);
1181+
assert_different_registers(dst, b, atmp, btmp);
11801182

11811183
bool is_min = (opcode == Op_MinV || opcode == Op_MinReductionV);
11821184
bool is_double_word = is_double_word_type(elem_bt);

‎test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (c) 2022, 2023, Arm Limited. All rights reserved.
3+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
34
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45
*
56
* This code is free software; you can redistribute it and/or modify it
@@ -237,6 +238,17 @@ public double[] vectorMax() {
237238
return res;
238239
}
239240

241+
@Test
242+
@IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"},
243+
counts = {IRNode.MAX_VD, ">0"})
244+
public double[] vectorMax_8322090() {
245+
double[] res = new double[SIZE];
246+
for (int i = 0; i < SIZE; i++) {
247+
res[i] = Math.max(d[i], d[i]);
248+
}
249+
return res;
250+
}
251+
240252
@Test
241253
@IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"},
242254
counts = {IRNode.MIN_VD, ">0"})

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Jan 12, 2024

@openjdk-notifier[bot]
This repository has been archived.