Skip to content

Commit 86d588b

Browse files
dafedafeTobiHartmann
authored andcommitted
8283740: C1: Convert flag TwoOperandLIRForm to a constant on all platforms
Reviewed-by: thartmann, chagedorn
1 parent ec95991 commit 86d588b

19 files changed

+53
-33
lines changed

src/hotspot/cpu/aarch64/c1_Defs_aarch64.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -78,4 +78,8 @@ enum {
7878
pd_float_saved_as_double = false
7979
};
8080

81+
enum {
82+
pd_two_operand_lir_form = false
83+
};
84+
8185
#endif // CPU_AARCH64_C1_DEFS_AARCH64_HPP

src/hotspot/cpu/aarch64/c1_globals_aarch64.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -60,6 +60,5 @@ define_pd_global(bool, UseTypeProfile, false);
6060

6161
define_pd_global(bool, OptimizeSinglePrecision, true );
6262
define_pd_global(bool, CSEArrayLength, false);
63-
define_pd_global(bool, TwoOperandLIRForm, false );
6463

6564
#endif // CPU_AARCH64_C1_GLOBALS_AARCH64_HPP

src/hotspot/cpu/arm/c1_Defs_arm.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -74,6 +74,10 @@ enum {
7474
pd_float_saved_as_double = false
7575
};
7676

77+
enum {
78+
pd_two_operand_lir_form = false
79+
};
80+
7781
#define PATCHED_ADDR (204)
7882
#define CARDTABLEBARRIERSET_POST_BARRIER_HELPER
7983

src/hotspot/cpu/arm/c1_globals_arm.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -61,6 +61,5 @@ define_pd_global(bool, UseTypeProfile, false);
6161

6262
define_pd_global(bool, OptimizeSinglePrecision, true);
6363
define_pd_global(bool, CSEArrayLength, true);
64-
define_pd_global(bool, TwoOperandLIRForm, false);
6564

6665
#endif // CPU_ARM_C1_GLOBALS_ARM_HPP

src/hotspot/cpu/ppc/c1_Defs_ppc.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -73,4 +73,8 @@ enum {
7373
pd_float_saved_as_double = true
7474
};
7575

76+
enum {
77+
pd_two_operand_lir_form = false
78+
};
79+
7680
#endif // CPU_PPC_C1_DEFS_PPC_HPP

src/hotspot/cpu/ppc/c1_globals_ppc.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2012, 2019 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -61,6 +61,5 @@ define_pd_global(bool, UseTypeProfile, false);
6161

6262
define_pd_global(bool, OptimizeSinglePrecision, false);
6363
define_pd_global(bool, CSEArrayLength, true);
64-
define_pd_global(bool, TwoOperandLIRForm, false);
6564

6665
#endif // CPU_PPC_C1_GLOBALS_PPC_HPP

src/hotspot/cpu/riscv/c1_Defs_riscv.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -81,4 +81,8 @@ enum {
8181
pd_float_saved_as_double = false
8282
};
8383

84+
enum {
85+
pd_two_operand_lir_form = false
86+
};
87+
8488
#endif // CPU_RISCV_C1_DEFS_RISCV_HPP

src/hotspot/cpu/riscv/c1_globals_riscv.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -60,6 +60,5 @@ define_pd_global(bool, UseTypeProfile, false);
6060

6161
define_pd_global(bool, OptimizeSinglePrecision, true );
6262
define_pd_global(bool, CSEArrayLength, false);
63-
define_pd_global(bool, TwoOperandLIRForm, false);
6463

6564
#endif // CPU_RISCV_C1_GLOBALS_RISCV_HPP

src/hotspot/cpu/s390/c1_Defs_s390.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2016 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -68,4 +68,8 @@ enum {
6868
pd_float_saved_as_double = false
6969
};
7070

71+
enum {
72+
pd_two_operand_lir_form = true
73+
};
74+
7175
#endif // CPU_S390_C1_DEFS_S390_HPP

src/hotspot/cpu/s390/c1_globals_s390.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2016, 2018 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -61,6 +61,5 @@ define_pd_global(bool, UseTypeProfile, false);
6161

6262
define_pd_global(bool, OptimizeSinglePrecision, false);
6363
define_pd_global(bool, CSEArrayLength, true);
64-
define_pd_global(bool, TwoOperandLIRForm, true);
6564

6665
#endif // CPU_S390_C1_GLOBALS_S390_HPP

src/hotspot/cpu/x86/c1_Defs_x86.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -75,4 +75,8 @@ enum {
7575
pd_float_saved_as_double = true
7676
};
7777

78+
enum {
79+
pd_two_operand_lir_form = true
80+
};
81+
7882
#endif // CPU_X86_C1_DEFS_X86_HPP

src/hotspot/cpu/x86/c1_globals_x86.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -59,6 +59,5 @@ define_pd_global(bool, UseTypeProfile, false);
5959

6060
define_pd_global(bool, OptimizeSinglePrecision, true );
6161
define_pd_global(bool, CSEArrayLength, false);
62-
define_pd_global(bool, TwoOperandLIRForm, true );
6362

6463
#endif // CPU_X86_C1_GLOBALS_X86_HPP

src/hotspot/share/c1/c1_Defs.hpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -56,4 +56,9 @@ enum {
5656
float_saved_as_double = pd_float_saved_as_double
5757
};
5858

59+
// true if LIR requires src1 and dst to match in binary LIR ops
60+
enum {
61+
two_operand_lir_form = pd_two_operand_lir_form
62+
};
63+
5964
#endif // SHARE_C1_C1_DEFS_HPP

src/hotspot/share/c1/c1_LIR.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ void LIR_Op2::verify() const {
194194
"can't produce oops from arith");
195195
}
196196

197-
if (TwoOperandLIRForm) {
197+
if (two_operand_lir_form) {
198198

199199
#ifdef ASSERT
200200
bool threeOperandForm = false;

src/hotspot/share/c1/c1_LIRGenerator.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ void LIRGenerator::arithmetic_op(Bytecodes::Code code, LIR_Opr result, LIR_Opr l
491491
LIR_Opr left_op = left;
492492
LIR_Opr right_op = right;
493493

494-
if (TwoOperandLIRForm && left_op != result_op) {
494+
if (two_operand_lir_form && left_op != result_op) {
495495
assert(right_op != result_op, "malformed");
496496
__ move(left_op, result_op);
497497
left_op = result_op;
@@ -563,7 +563,7 @@ void LIRGenerator::arithmetic_op_fpu(Bytecodes::Code code, LIR_Opr result, LIR_O
563563

564564
void LIRGenerator::shift_op(Bytecodes::Code code, LIR_Opr result_op, LIR_Opr value, LIR_Opr count, LIR_Opr tmp) {
565565

566-
if (TwoOperandLIRForm && value != result_op
566+
if (two_operand_lir_form && value != result_op
567567
// Only 32bit right shifts require two operand form on S390.
568568
S390_ONLY(&& (code == Bytecodes::_ishr || code == Bytecodes::_iushr))) {
569569
assert(count != result_op, "malformed");
@@ -585,7 +585,7 @@ void LIRGenerator::shift_op(Bytecodes::Code code, LIR_Opr result_op, LIR_Opr val
585585

586586

587587
void LIRGenerator::logic_op (Bytecodes::Code code, LIR_Opr result_op, LIR_Opr left_op, LIR_Opr right_op) {
588-
if (TwoOperandLIRForm && left_op != result_op) {
588+
if (two_operand_lir_form && left_op != result_op) {
589589
assert(right_op != result_op, "malformed");
590590
__ move(left_op, result_op);
591591
left_op = result_op;
@@ -3547,7 +3547,7 @@ void LIRGenerator::do_MemBar(MemBar* x) {
35473547

35483548
LIR_Opr LIRGenerator::mask_boolean(LIR_Opr array, LIR_Opr value, CodeEmitInfo*& null_check_info) {
35493549
LIR_Opr value_fixed = rlock_byte(T_BYTE);
3550-
if (TwoOperandLIRForm) {
3550+
if (two_operand_lir_form) {
35513551
__ move(value, value_fixed);
35523552
__ logical_and(value_fixed, LIR_OprFact::intConst(1), value_fixed);
35533553
} else {

src/hotspot/share/c1/c1_globals.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,6 @@
203203
develop_pd(bool, CSEArrayLength, \
204204
"Create separate nodes for length in array accesses") \
205205
\
206-
develop_pd(bool, TwoOperandLIRForm, \
207-
"true if LIR requires src1 and dst to match in binary LIR ops") \
208-
\
209206
develop(intx, TraceLinearScanLevel, 0, \
210207
"Debug levels for the linear scan allocator") \
211208
range(0, 4) \

src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -153,7 +153,7 @@ void G1BarrierSetC1::post_barrier(LIRAccess& access, LIR_Opr addr, LIR_Opr new_v
153153

154154
LIR_Opr xor_res = gen->new_pointer_register();
155155
LIR_Opr xor_shift_res = gen->new_pointer_register();
156-
if (TwoOperandLIRForm) {
156+
if (two_operand_lir_form) {
157157
__ move(addr, xor_res);
158158
__ logical_xor(xor_res, new_val, xor_res);
159159
__ move(xor_res, xor_shift_res);

src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@ void CardTableBarrierSetC1::post_barrier(LIRAccess& access, LIR_Opr addr, LIR_Op
6666
gen->CardTableBarrierSet_post_barrier_helper(addr, card_table_base);
6767
#else
6868
LIR_Opr tmp = gen->new_pointer_register();
69-
if (TwoOperandLIRForm) {
69+
if (two_operand_lir_form) {
7070
LIR_Opr addr_opr = LIR_OprFact::address(new LIR_Address(addr, addr->type()));
7171
__ leal(addr_opr, tmp);
7272
__ unsigned_shift_right(tmp, CardTable::card_shift(), tmp);

src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
2+
* Copyright (c) 2018, 2022, Red Hat, Inc. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -146,7 +146,7 @@ LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier_impl(LIRGenerator* gen, L
146146
LIR_Opr mask_reg = gen->new_register(T_INT);
147147
__ move(mask, mask_reg);
148148

149-
if (TwoOperandLIRForm) {
149+
if (two_operand_lir_form) {
150150
__ logical_and(flag_val, mask_reg, flag_val);
151151
} else {
152152
LIR_Opr masked_flag = gen->new_register(T_INT);

0 commit comments

Comments
 (0)