Skip to content
Permalink
Browse files

7175279: Don't use x87 FPU on x86-64

Reviewed-by: kvn, roland
  • Loading branch information
Vladimir Ivanov
Vladimir Ivanov committed Jan 29, 2020
1 parent a2bbf93 commit 5b5a5353e7c1e6abf8cd73271393d55aa131527c
Showing with 381 additions and 409 deletions.
  1. +0 −12 src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
  2. +0 −1 src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp
  3. +0 −24 src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp
  4. +0 −29 src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
  5. +0 −24 src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp
  6. +0 −29 src/hotspot/cpu/sparc/c1_LIRAssembler_sparc.cpp
  7. +14 −3 src/hotspot/cpu/x86/assembler_x86.cpp
  8. +8 −5 src/hotspot/cpu/x86/assembler_x86.hpp
  9. +2 −1 src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp
  10. +107 −25 src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp
  11. +9 −2 src/hotspot/cpu/x86/c1_LIRAssembler_x86.hpp
  12. +47 −4 src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp
  13. +6 −6 src/hotspot/cpu/x86/c1_LinearScan_x86.cpp
  14. +4 −4 src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp
  15. +39 −30 src/hotspot/cpu/x86/c1_Runtime1_x86.cpp
  16. +79 −58 src/hotspot/cpu/x86/macroAssembler_x86.cpp
  17. +16 −14 src/hotspot/cpu/x86/macroAssembler_x86.hpp
  18. +9 −1 src/hotspot/cpu/x86/methodHandles_x86.cpp
  19. +11 −10 src/hotspot/cpu/x86/stubGenerator_x86_64.cpp
  20. +5 −16 src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp
  21. +8 −74 src/hotspot/cpu/x86/x86_64.ad
  22. +1 −0 src/hotspot/share/c1/c1_CodeStubs.hpp
  23. +0 −6 src/hotspot/share/c1/c1_LIR.cpp
  24. +0 −5 src/hotspot/share/c1/c1_LIR.hpp
  25. +7 −15 src/hotspot/share/c1/c1_LIRAssembler.cpp
  26. +0 −7 src/hotspot/share/c1/c1_LIRAssembler.hpp
  27. +8 −3 src/hotspot/share/c1/c1_LinearScan.cpp
  28. +1 −1 src/hotspot/share/c1/c1_LinearScan.hpp
@@ -138,18 +138,6 @@ address LIR_Assembler::int_constant(jlong n) {
}
}

void LIR_Assembler::set_24bit_FPU() { Unimplemented(); }

void LIR_Assembler::reset_FPU() { Unimplemented(); }

void LIR_Assembler::fpop() { Unimplemented(); }

void LIR_Assembler::fxch(int i) { Unimplemented(); }

void LIR_Assembler::fld(int i) { Unimplemented(); }

void LIR_Assembler::ffree(int i) { Unimplemented(); }

void LIR_Assembler::breakpoint() { Unimplemented(); }

void LIR_Assembler::push(LIR_Opr opr) { Unimplemented(); }
@@ -1127,7 +1127,6 @@ void LIRGenerator::do_Convert(Convert* x) {
// arguments of lir_convert
LIR_Opr conv_input = input;
LIR_Opr conv_result = result;
ConversionStub* stub = NULL;

__ convert(x->op(), conv_input, conv_result);

@@ -86,30 +86,6 @@ void LIR_Assembler::store_parameter(Metadata* m, int offset_from_sp_in_words) {
//--------------fpu register translations-----------------------


void LIR_Assembler::set_24bit_FPU() {
ShouldNotReachHere();
}

void LIR_Assembler::reset_FPU() {
ShouldNotReachHere();
}

void LIR_Assembler::fpop() {
Unimplemented();
}

void LIR_Assembler::fxch(int i) {
Unimplemented();
}

void LIR_Assembler::fld(int i) {
Unimplemented();
}

void LIR_Assembler::ffree(int i) {
Unimplemented();
}

void LIR_Assembler::breakpoint() {
__ breakpoint();
}
@@ -1726,12 +1726,6 @@ void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr
}


void LIR_Assembler::fpop() {
Unimplemented();
// do nothing
}


void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr thread, LIR_Opr dest, LIR_Op* op) {
switch (code) {
case lir_sqrt: {
@@ -2691,16 +2685,6 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
}
}


void LIR_Assembler::set_24bit_FPU() {
Unimplemented();
}

void LIR_Assembler::reset_FPU() {
Unimplemented();
}


void LIR_Assembler::breakpoint() {
__ illtrap();
}
@@ -2894,19 +2878,6 @@ void LIR_Assembler::negate(LIR_Opr left, LIR_Opr dest, LIR_Opr tmp) {
}


void LIR_Assembler::fxch(int i) {
Unimplemented();
}

void LIR_Assembler::fld(int i) {
Unimplemented();
}

void LIR_Assembler::ffree(int i) {
Unimplemented();
}


void LIR_Assembler::rt_call(LIR_Opr result, address dest,
const LIR_OprList* args, LIR_Opr tmp, CodeEmitInfo* info) {
// Stubs: Called via rt_call, but dest is a stub address (no function descriptor).
@@ -1698,10 +1698,6 @@ void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr
}
}

void LIR_Assembler::fpop() {
// do nothing
}

void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr thread, LIR_Opr dest, LIR_Op* op) {
switch (code) {
case lir_sqrt: {
@@ -2739,14 +2735,6 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
}
}

void LIR_Assembler::set_24bit_FPU() {
ShouldNotCallThis(); // x86 only
}

void LIR_Assembler::reset_FPU() {
ShouldNotCallThis(); // x86 only
}

void LIR_Assembler::breakpoint() {
Unimplemented();
// __ breakpoint_trap();
@@ -2887,18 +2875,6 @@ void LIR_Assembler::negate(LIR_Opr left, LIR_Opr dest, LIR_Opr tmp) {
}
}

void LIR_Assembler::fxch(int i) {
ShouldNotCallThis(); // x86 only
}

void LIR_Assembler::fld(int i) {
ShouldNotCallThis(); // x86 only
}

void LIR_Assembler::ffree(int i) {
ShouldNotCallThis(); // x86 only
}

void LIR_Assembler::rt_call(LIR_Opr result, address dest,
const LIR_OprList* args, LIR_Opr tmp, CodeEmitInfo* info) {
assert(!tmp->is_valid(), "don't need temporary");
@@ -1732,12 +1732,6 @@ void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr
}
}


void LIR_Assembler::fpop() {
// do nothing
}


void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr thread, LIR_Opr dest, LIR_Op* op) {
switch (code) {
case lir_tan: {
@@ -2658,16 +2652,6 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
}
}

void LIR_Assembler::set_24bit_FPU() {
Unimplemented();
}


void LIR_Assembler::reset_FPU() {
Unimplemented();
}


void LIR_Assembler::breakpoint() {
__ breakpoint_trap();
}
@@ -3057,19 +3041,6 @@ void LIR_Assembler::negate(LIR_Opr left, LIR_Opr dest, LIR_Opr tmp) {
}
}


void LIR_Assembler::fxch(int i) {
Unimplemented();
}

void LIR_Assembler::fld(int i) {
Unimplemented();
}

void LIR_Assembler::ffree(int i) {
Unimplemented();
}

void LIR_Assembler::rt_call(LIR_Opr result, address dest,
const LIR_OprList* args, LIR_Opr tmp, CodeEmitInfo* info) {

@@ -7330,9 +7330,7 @@ void Assembler::decl(Register dst) {
emit_int8(0x48 | dst->encoding());
}

#endif // _LP64

// 64bit typically doesn't use the x87 but needs to for the trig funcs
// 64bit doesn't use the x87

void Assembler::fabs() {
emit_int8((unsigned char)0xD9);
@@ -7767,6 +7765,7 @@ void Assembler::fldl2e() {
emit_int8((unsigned char)0xD9);
emit_int8((unsigned char)0xEA);
}
#endif // !_LP64

// SSE SIMD prefix byte values corresponding to VexSimdPrefix encoding.
static int simd_pre[4] = { 0, 0x66, 0xF3, 0xF2 };
@@ -8834,6 +8833,18 @@ void Assembler::cvtsi2ssq(XMMRegister dst, Address src) {
emit_operand(dst, src);
}

void Assembler::cvttsd2siq(Register dst, Address src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// F2 REX.W 0F 2C /r
// CVTTSD2SI r64, xmm1/m64
InstructionMark im(this);
emit_int8((unsigned char)0xF2);
prefix(REX_W);
emit_int8(0x0F);
emit_int8(0x2C);
emit_operand(dst, src);
}

void Assembler::cvttsd2siq(Register dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
@@ -1110,6 +1110,7 @@ class Assembler : public AbstractAssembler {
// Convert with Truncation Scalar Double-Precision Floating-Point Value to Doubleword Integer
void cvttsd2sil(Register dst, Address src);
void cvttsd2sil(Register dst, XMMRegister src);
void cvttsd2siq(Register dst, Address src);
void cvttsd2siq(Register dst, XMMRegister src);

// Convert with Truncation Scalar Single-Precision Floating-Point Value to Doubleword Integer
@@ -1137,6 +1138,7 @@ class Assembler : public AbstractAssembler {

void emms();

#ifndef _LP64
void fabs();

void fadd(int i);
@@ -1270,17 +1272,18 @@ class Assembler : public AbstractAssembler {

void fxch(int i = 1);

void fyl2x();
void frndint();
void f2xm1();
void fldl2e();
#endif // !_LP64

void fxrstor(Address src);
void xrstor(Address src);

void fxsave(Address dst);
void xsave(Address dst);

void fyl2x();
void frndint();
void f2xm1();
void fldl2e();

void hlt();

void idivl(Register src);
@@ -37,6 +37,7 @@

#define __ ce->masm()->

#ifndef _LP64
float ConversionStub::float_zero = 0.0;
double ConversionStub::double_zero = 0.0;

@@ -52,7 +53,6 @@ void ConversionStub::emit_code(LIR_Assembler* ce) {
__ comisd(input()->as_xmm_double_reg(),
ExternalAddress((address)&double_zero));
} else {
LP64_ONLY(ShouldNotReachHere());
__ push(rax);
__ ftst();
__ fnstsw_ax();
@@ -76,6 +76,7 @@ void ConversionStub::emit_code(LIR_Assembler* ce) {
__ bind(do_return);
__ jmp(_continuation);
}
#endif // !_LP64

void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);

0 comments on commit 5b5a535

Please sign in to comment.