Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/hotspot/cpu/aarch64/c1_Defs_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ enum {
pd_hi_word_offset_in_bytes = BytesPerWord
};

// explicit rounding operations are required to implement the strictFP mode
enum {
pd_strict_fp_requires_explicit_rounding = false
};

// FIXME: There are no callee-saved

// registers
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ void LIRGenerator::do_ArithmeticOp_FPU(ArithmeticOp* x) {

arithmetic_op_fpu(x->op(), reg, left.result(), right.result());

set_result(x, round_item(reg));
set_result(x, reg);
}

// for _ladd, _lmul, _lsub, _ldiv, _lrem
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/cpu/aarch64/matcher_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@
// C code as the Java calling convention forces doubles to be aligned.
static const bool misaligned_doubles_ok = true;

// Advertise here if the CPU requires explicit rounding operations to implement strictfp mode.
static const bool strict_fp_requires_explicit_rounding = false;

// Are floats converted to double when stored to stack during
// deoptimization?
static constexpr bool float_in_double() { return false; }
Expand Down
12 changes: 0 additions & 12 deletions src/hotspot/cpu/arm/arm.ad
Original file line number Diff line number Diff line change
Expand Up @@ -4510,18 +4510,6 @@ instruct unnecessary_membar_volatile() %{
%}

//----------Register Move Instructions-----------------------------------------
// instruct roundDouble_nop(regD dst) %{
// match(Set dst (RoundDouble dst));
// ins_pipe(empty);
// %}


// instruct roundFloat_nop(regF dst) %{
// match(Set dst (RoundFloat dst));
// ins_pipe(empty);
// %}



// Cast Index to Pointer for unsafe natives
instruct castX2P(iRegX src, iRegP dst) %{
Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/cpu/arm/c1_Defs_arm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ enum {
pd_hi_word_offset_in_bytes = BytesPerWord
};

// explicit rounding operations are required to implement the strictFP mode
enum {
pd_strict_fp_requires_explicit_rounding = false
};

#ifdef __SOFTFP__
#define SOFT(n) n
#define VFP(n)
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/cpu/arm/matcher_arm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@
// Java calling convention forces doubles to be aligned.
static const bool misaligned_doubles_ok = false;

// Advertise here if the CPU requires explicit rounding operations to implement strictfp mode.
static const bool strict_fp_requires_explicit_rounding = false;

// Are floats converted to double when stored to stack during deoptimization?
// ARM does not handle callee-save floats.
static constexpr bool float_in_double() {
Expand Down
6 changes: 0 additions & 6 deletions src/hotspot/cpu/ppc/c1_Defs_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ enum {
};


// Explicit rounding operations are not required to implement the strictFP mode.
enum {
pd_strict_fp_requires_explicit_rounding = false
};


// registers
enum {
pd_nof_cpu_regs_frame_map = 32, // Number of registers used during code emission.
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/cpu/ppc/matcher_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@
// Java calling convention forces doubles to be aligned.
static const bool misaligned_doubles_ok = true;

// Advertise here if the CPU requires explicit rounding operations to implement strictfp mode.
static const bool strict_fp_requires_explicit_rounding = false;

// Do floats take an entire double register or just half?
//
// A float occupies a ppc64 double register. For the allocator, a
Expand Down
22 changes: 0 additions & 22 deletions src/hotspot/cpu/ppc/ppc.ad
Original file line number Diff line number Diff line change
Expand Up @@ -9537,28 +9537,6 @@ instruct sqrtF_reg(regF dst, regF src) %{
ins_pipe(pipe_class_default);
%}

instruct roundDouble_nop(regD dst) %{
match(Set dst (RoundDouble dst));
ins_cost(0);

format %{ " -- \t// RoundDouble not needed - empty" %}
size(0);
// PPC results are already "rounded" (i.e., normal-format IEEE).
ins_encode( /*empty*/ );
ins_pipe(pipe_class_default);
%}

instruct roundFloat_nop(regF dst) %{
match(Set dst (RoundFloat dst));
ins_cost(0);

format %{ " -- \t// RoundFloat not needed - empty" %}
size(0);
// PPC results are already "rounded" (i.e., normal-format IEEE).
ins_encode( /*empty*/ );
ins_pipe(pipe_class_default);
%}


// Multiply-Accumulate
// src1 * src2 + src3
Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/cpu/riscv/c1_Defs_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ enum {
pd_hi_word_offset_in_bytes = BytesPerWord
};

// explicit rounding operations are required to implement the strictFP mode
enum {
pd_strict_fp_requires_explicit_rounding = false
};

// registers
enum {
pd_nof_cpu_regs_frame_map = Register::number_of_registers, // number of registers used during code emission
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void LIRGenerator::do_ArithmeticOp_FPU(ArithmeticOp* x) {
LIR_Opr reg = rlock(x);
arithmetic_op_fpu(x->op(), reg, left.result(), right.result());

set_result(x, round_item(reg));
set_result(x, reg);
}

// for _ladd, _lmul, _lsub, _ldiv, _lrem
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/cpu/riscv/matcher_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@
// C code as the Java calling convention forces doubles to be aligned.
static const bool misaligned_doubles_ok = true;

// Advertise here if the CPU requires explicit rounding operations to implement strictfp mode.
static const bool strict_fp_requires_explicit_rounding = false;

// Are floats converted to double when stored to stack during
// deoptimization?
static constexpr bool float_in_double() { return false; }
Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/cpu/s390/c1_Defs_s390.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ enum {
pd_hi_word_offset_in_bytes = 0
};

// Explicit rounding operations are not required to implement the strictFP mode.
enum {
pd_strict_fp_requires_explicit_rounding = false
};

// registers
enum {
pd_nof_cpu_regs_frame_map = 16, // Number of registers used during code emission.
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/cpu/s390/matcher_s390.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@
// Java calling convention forces doubles to be aligned.
static const bool misaligned_doubles_ok = true;

// Advertise here if the CPU requires explicit rounding operations to implement strictfp mode.
static const bool strict_fp_requires_explicit_rounding = false;

// Do floats take an entire double register or just half?
//
// A float in resides in a zarch double register. When storing it by
Expand Down
17 changes: 0 additions & 17 deletions src/hotspot/cpu/s390/s390.ad
Original file line number Diff line number Diff line change
Expand Up @@ -5317,23 +5317,6 @@ instruct membar_storestore() %{


//----------Register Move Instructions-----------------------------------------
instruct roundDouble_nop(regD dst) %{
match(Set dst (RoundDouble dst));
ins_cost(0);
// TODO: s390 port size(FIXED_SIZE);
// z/Architecture results are already "rounded" (i.e., normal-format IEEE).
ins_encode();
ins_pipe(pipe_class_dummy);
%}

instruct roundFloat_nop(regF dst) %{
match(Set dst (RoundFloat dst));
ins_cost(0);
// TODO: s390 port size(FIXED_SIZE);
// z/Architecture results are already "rounded" (i.e., normal-format IEEE).
ins_encode();
ins_pipe(pipe_class_dummy);
%}

// Cast Long to Pointer for unsafe natives.
instruct castX2P(iRegP dst, iRegL src) %{
Expand Down
6 changes: 0 additions & 6 deletions src/hotspot/cpu/x86/c1_Defs_x86.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ enum {
pd_hi_word_offset_in_bytes = BytesPerWord
};

// explicit rounding operations are required to implement the strictFP mode
enum {
pd_strict_fp_requires_explicit_rounding = LP64_ONLY( false ) NOT_LP64 ( true )
};


// registers
enum {
pd_nof_cpu_regs_frame_map = NOT_LP64(8) LP64_ONLY(16), // number of registers used during code emission
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ void LIRGenerator::do_NegateOp(NegateOp* x) {

__ negate(value.result(), reg);

set_result(x, round_item(reg));
set_result(x, reg);
}

// for _fadd, _fmul, _fsub, _fdiv, _frem
Expand Down Expand Up @@ -433,7 +433,7 @@ void LIRGenerator::do_ArithmeticOp_FPU(ArithmeticOp* x) {
__ move(result_reg, result);
} else {
arithmetic_op_fpu(x->op(), reg, left.result(), right.result(), tmp);
set_result(x, round_item(reg));
set_result(x, reg);
}
#else
if ((UseSSE >= 1 && x->op() == Bytecodes::_frem) || (UseSSE >= 2 && x->op() == Bytecodes::_drem)) {
Expand All @@ -454,7 +454,7 @@ void LIRGenerator::do_ArithmeticOp_FPU(ArithmeticOp* x) {
} else {
arithmetic_op_fpu(x->op(), reg, left.result(), right.result(), tmp);
}
set_result(x, round_item(reg));
set_result(x, reg);
#endif // _LP64
}

Expand Down
10 changes: 0 additions & 10 deletions src/hotspot/cpu/x86/c1_LinearScan_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,16 +624,6 @@ void FpuStackAllocator::handle_op1(LIR_Op1* op1) {
break;
}

case lir_roundfp: {
assert(in->is_fpu_register() && !in->is_xmm_register(), "input must be in register");
assert(res->is_stack(), "result must be on stack");

insert_exchange(in);
new_in = to_fpu_stack_top(in);
pop_if_last_use(op1, in);
break;
}

case lir_abs:
case lir_sqrt:
case lir_neg: {
Expand Down
7 changes: 0 additions & 7 deletions src/hotspot/cpu/x86/matcher_x86.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@
// Java calling convention forces doubles to be aligned.
static const bool misaligned_doubles_ok = true;

// Advertise here if the CPU requires explicit rounding operations to implement strictfp mode.
#ifdef _LP64
static const bool strict_fp_requires_explicit_rounding = false;
#else
static const bool strict_fp_requires_explicit_rounding = true;
#endif

// Are floats converted to double when stored to stack during deoptimization?
// On x64 it is stored without conversion so we can use normal access.
// On x32 it is stored with conversion only when FPU is used for floats.
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/adlc/formssel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4225,9 +4225,7 @@ int MatchRule::is_expensive() const {
strcmp(opType,"FmaD") == 0 ||
strcmp(opType,"FmaF") == 0 ||
strcmp(opType,"FmaHF") == 0 ||
strcmp(opType,"RoundDouble")==0 ||
strcmp(opType,"RoundDoubleMode")==0 ||
strcmp(opType,"RoundFloat")==0 ||
strcmp(opType,"ReverseBytesI")==0 ||
strcmp(opType,"ReverseBytesL")==0 ||
strcmp(opType,"ReverseBytesUS")==0 ||
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/c1/c1_Canonicalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,6 @@ void Canonicalizer::do_Throw (Throw* x) {}
void Canonicalizer::do_Base (Base* x) {}
void Canonicalizer::do_OsrEntry (OsrEntry* x) {}
void Canonicalizer::do_ExceptionObject(ExceptionObject* x) {}
void Canonicalizer::do_RoundFP (RoundFP* x) {}
void Canonicalizer::do_UnsafeGet (UnsafeGet* x) {}
void Canonicalizer::do_UnsafePut (UnsafePut* x) {}
void Canonicalizer::do_UnsafeGetAndSet(UnsafeGetAndSet* x) {}
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/c1/c1_Canonicalizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class Canonicalizer: InstructionVisitor {
virtual void do_Base (Base* x);
virtual void do_OsrEntry (OsrEntry* x);
virtual void do_ExceptionObject(ExceptionObject* x);
virtual void do_RoundFP (RoundFP* x);
virtual void do_UnsafeGet (UnsafeGet* x);
virtual void do_UnsafePut (UnsafePut* x);
virtual void do_UnsafeGetAndSet(UnsafeGetAndSet* x);
Expand Down
7 changes: 0 additions & 7 deletions src/hotspot/share/c1/c1_Defs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ enum {
hi_word_offset_in_bytes = pd_hi_word_offset_in_bytes
};


// the processor may require explicit rounding operations to implement the strictFP mode
enum {
strict_fp_requires_explicit_rounding = pd_strict_fp_requires_explicit_rounding
};


// for debug info: a float value in a register may be saved in double precision by runtime stubs
enum {
float_saved_as_double = pd_float_saved_as_double
Expand Down
43 changes: 3 additions & 40 deletions src/hotspot/share/c1/c1_GraphBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,17 +673,6 @@ class MemoryBuffer: public CompilationResourceObj {
return load;
}

if (strict_fp_requires_explicit_rounding && load->type()->is_float_kind()) {
#ifdef IA32
if (UseSSE < 2) {
// can't skip load since value might get rounded as a side effect
return load;
}
#else
Unimplemented();
#endif // IA32
}

ciField* field = load->field();
Value object = load->obj();
if (field->holder()->is_loaded() && !field->is_volatile()) {
Expand Down Expand Up @@ -1052,7 +1041,7 @@ void GraphBuilder::store_local(ValueStack* state, Value x, int index) {
}
}

state->store_local(index, round_fp(x));
state->store_local(index, x);
}


Expand Down Expand Up @@ -1204,10 +1193,7 @@ void GraphBuilder::arithmetic_op(ValueType* type, Bytecodes::Code code, ValueSta
Value y = pop(type);
Value x = pop(type);
Value res = new ArithmeticOp(code, x, y, state_before);
// Note: currently single-precision floating-point rounding on Intel is handled at the LIRGenerator level
res = append(res);
res = round_fp(res);
push(type, res);
push(type, append(res));
}


Expand Down Expand Up @@ -2228,7 +2214,7 @@ void GraphBuilder::invoke(Bytecodes::Code code) {
append_split(result);

if (result_type != voidType) {
push(result_type, round_fp(result));
push(result_type, result);
}
if (profile_return() && result_type->is_object_kind()) {
profile_return_type(result, target);
Expand Down Expand Up @@ -2356,29 +2342,6 @@ void GraphBuilder::throw_op(int bci) {
}


Value GraphBuilder::round_fp(Value fp_value) {
if (strict_fp_requires_explicit_rounding) {
#ifdef IA32
// no rounding needed if SSE2 is used
if (UseSSE < 2) {
// Must currently insert rounding node for doubleword values that
// are results of expressions (i.e., not loads from memory or
// constants)
if (fp_value->type()->tag() == doubleTag &&
fp_value->as_Constant() == nullptr &&
fp_value->as_Local() == nullptr && // method parameters need no rounding
fp_value->as_RoundFP() == nullptr) {
return append(new RoundFP(fp_value));
}
}
#else
Unimplemented();
#endif // IA32
}
return fp_value;
}


Instruction* GraphBuilder::append_with_bci(Instruction* instr, int bci) {
Canonicalizer canon(compilation(), instr, bci);
Instruction* i1 = canon.canonical();
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/c1/c1_GraphBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ class GraphBuilder {
void monitorexit(Value x, int bci);
void new_multi_array(int dimensions);
void throw_op(int bci);
Value round_fp(Value fp_value);

// stack/code manipulation helpers
Instruction* append_with_bci(Instruction* instr, int bci);
Expand Down
Loading