Skip to content

Commit a678416

Browse files
author
Kim Barrett
committed
8322805: Eliminate -Wparentheses warnings in x86 code
Reviewed-by: dholmes, kvn
1 parent 122bc77 commit a678416

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

src/hotspot/cpu/x86/assembler_x86.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2024, 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
@@ -889,8 +889,8 @@ address Assembler::locate_operand(address inst, WhichOperand which) {
889889
assert(which == imm_operand || which == disp32_operand,
890890
"which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip));
891891
#else
892-
assert((which == call32_operand || which == imm_operand) && is_64bit ||
893-
which == narrow_oop_operand && !is_64bit,
892+
assert(((which == call32_operand || which == imm_operand) && is_64bit) ||
893+
(which == narrow_oop_operand && !is_64bit),
894894
"which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip));
895895
#endif // _LP64
896896
return ip;
@@ -7235,15 +7235,15 @@ void Assembler::vxorps(XMMRegister dst, XMMRegister nds, Address src, int vector
72357235

72367236
// Integer vector arithmetic
72377237
void Assembler::vphaddw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
7238-
assert(VM_Version::supports_avx() && (vector_len == 0) ||
7238+
assert((VM_Version::supports_avx() && (vector_len == 0)) ||
72397239
VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
72407240
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true);
72417241
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
72427242
emit_int16(0x01, (0xC0 | encode));
72437243
}
72447244

72457245
void Assembler::vphaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
7246-
assert(VM_Version::supports_avx() && (vector_len == 0) ||
7246+
assert((VM_Version::supports_avx() && (vector_len == 0)) ||
72477247
VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
72487248
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true);
72497249
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2024, 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
@@ -5223,8 +5223,8 @@ void C2_MacroAssembler::vector_mask_operation(int opc, Register dst, KRegister m
52235223

52245224
void C2_MacroAssembler::vector_mask_operation(int opc, Register dst, XMMRegister mask, XMMRegister xtmp,
52255225
Register tmp, int masklen, BasicType bt, int vec_enc) {
5226-
assert(vec_enc == AVX_128bit && VM_Version::supports_avx() ||
5227-
vec_enc == AVX_256bit && (VM_Version::supports_avx2() || type2aelembytes(bt) >= 4), "");
5226+
assert((vec_enc == AVX_128bit && VM_Version::supports_avx()) ||
5227+
(vec_enc == AVX_256bit && (VM_Version::supports_avx2() || type2aelembytes(bt) >= 4)), "");
52285228
assert(VM_Version::supports_popcnt(), "");
52295229

52305230
bool need_clip = false;

src/hotspot/cpu/x86/frame_x86.inline.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2024, 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
@@ -181,7 +181,7 @@ inline bool frame::equal(frame other) const {
181181
&& unextended_sp() == other.unextended_sp()
182182
&& fp() == other.fp()
183183
&& pc() == other.pc();
184-
assert(!ret || ret && cb() == other.cb() && _deopt_state == other._deopt_state, "inconsistent construction");
184+
assert(!ret || (ret && cb() == other.cb() && _deopt_state == other._deopt_state), "inconsistent construction");
185185
return ret;
186186
}
187187

src/hotspot/cpu/x86/macroAssembler_x86.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ class MacroAssembler: public Assembler {
111111
op == 0xE9 /* jmp */ ||
112112
op == 0xEB /* short jmp */ ||
113113
(op & 0xF0) == 0x70 /* short jcc */ ||
114-
op == 0x0F && (branch[1] & 0xF0) == 0x80 /* jcc */ ||
115-
op == 0xC7 && branch[1] == 0xF8 /* xbegin */,
114+
(op == 0x0F && (branch[1] & 0xF0) == 0x80) /* jcc */ ||
115+
(op == 0xC7 && branch[1] == 0xF8) /* xbegin */,
116116
"Invalid opcode at patch point");
117117

118118
if (op == 0xEB || (op & 0xF0) == 0x70) {

src/hotspot/cpu/x86/vm_version_x86.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2024, 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
@@ -1178,7 +1178,7 @@ void VM_Version::get_processor_features() {
11781178
UseMD5Intrinsics = true;
11791179
}
11801180

1181-
if (supports_sha() LP64_ONLY(|| supports_avx2() && supports_bmi2())) {
1181+
if (supports_sha() LP64_ONLY(|| (supports_avx2() && supports_bmi2()))) {
11821182
if (FLAG_IS_DEFAULT(UseSHA)) {
11831183
UseSHA = true;
11841184
}

src/hotspot/cpu/x86/x86.ad

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
2+
// Copyright (c) 2011, 2024, 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
@@ -2532,8 +2532,8 @@ static inline Assembler::ComparisonPredicateFP booltest_pred_to_comparison_pred_
25322532
static void vec_mov_helper(CodeBuffer *cbuf, int src_lo, int dst_lo,
25332533
int src_hi, int dst_hi, uint ireg, outputStream* st) {
25342534
assert(ireg == Op_VecS || // 32bit vector
2535-
(src_lo & 1) == 0 && (src_lo + 1) == src_hi &&
2536-
(dst_lo & 1) == 0 && (dst_lo + 1) == dst_hi,
2535+
((src_lo & 1) == 0 && (src_lo + 1) == src_hi &&
2536+
(dst_lo & 1) == 0 && (dst_lo + 1) == dst_hi),
25372537
"no non-adjacent vector moves" );
25382538
if (cbuf) {
25392539
C2_MacroAssembler _masm(cbuf);

0 commit comments

Comments
 (0)