Navigation Menu

Skip to content

Commit

Permalink
8293285: x86_64: Move libm stub implementations to StubGenerator
Browse files Browse the repository at this point in the history
Reviewed-by: kvn
  • Loading branch information
Vladimir Ivanov committed Sep 6, 2022
1 parent 5b4c415 commit 57930f8
Show file tree
Hide file tree
Showing 18 changed files with 5,403 additions and 4,842 deletions.
54 changes: 2 additions & 52 deletions src/hotspot/cpu/x86/macroAssembler_x86.hpp
Expand Up @@ -1027,57 +1027,7 @@ class MacroAssembler: public Assembler {
XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7,
Register rax, Register rcx, Register rdx, Register tmp);

#ifdef _LP64
private:
// Initialized in macroAssembler_x86_constants.cpp
static address ONE;
static address ONEHALF;
static address SIGN_MASK;
static address TWO_POW_55;
static address TWO_POW_M55;
static address SHIFTER;
static address ZERO;
static address NEG_ZERO;
static address PI32INV;
static address PI_INV_TABLE;
static address Ctable;
static address SC_1;
static address SC_2;
static address SC_3;
static address SC_4;
static address PI_4;
static address P_1;
static address P_3;
static address P_2;

public:
void fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3,
XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7,
Register rax, Register rcx, Register rdx, Register tmp1, Register tmp2);

void fast_log10(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3,
XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7,
Register rax, Register rcx, Register rdx, Register r11, Register tmp);

void fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4,
XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register rax, Register rcx,
Register rdx, Register tmp1, Register tmp2, Register tmp3, Register tmp4);

void fast_sin(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3,
XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7,
Register rax, Register rbx, Register rcx, Register rdx, Register tmp1);

void fast_cos(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3,
XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7,
Register rax, Register rcx, Register rdx, Register r8,
Register r9, Register r10, Register r11, Register tmp);

void fast_tan(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3,
XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7,
Register rax, Register rcx, Register rdx, Register r8,
Register r9, Register r10, Register r11, Register tmp);

#else
#ifndef _LP64
private:
// Initialized in macroAssembler_x86_constants.cpp
static address ONES;
Expand Down Expand Up @@ -1121,7 +1071,7 @@ class MacroAssembler: public Assembler {
void fast_tan(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3,
XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7,
Register rax, Register rcx, Register rdx, Register tmp);
#endif
#endif // !_LP64

private:

Expand Down
53 changes: 53 additions & 0 deletions src/hotspot/cpu/x86/macroAssembler_x86_32_constants.cpp
@@ -0,0 +1,53 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/

#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"

ATTRIBUTE_ALIGNED(16) juint _ONES[] = {
0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0xbff00000UL
};
address MacroAssembler::ONES = (address)_ONES;

ATTRIBUTE_ALIGNED(16) juint _PI4_INV[] = {
0x6dc9c883UL, 0x3ff45f30UL
};
address MacroAssembler::PI4_INV = (address)_PI4_INV;

ATTRIBUTE_ALIGNED(16) juint _PI4X3[] = {
0x54443000UL, 0xbfe921fbUL, 0x3b39a000UL, 0x3d373dcbUL, 0xe0e68948UL,
0xba845c06UL
};
address MacroAssembler::PI4X3 = (address)_PI4X3;

ATTRIBUTE_ALIGNED(16) juint _PI4X4[] = {
0x54400000UL, 0xbfe921fbUL, 0x1a600000UL, 0xbdc0b461UL, 0x2e000000UL,
0xbb93198aUL, 0x252049c1UL, 0xb96b839aUL
};
address MacroAssembler::PI4X4 = (address)_PI4X4;

ATTRIBUTE_ALIGNED(16) juint _L_2IL0FLOATPACKET_0[] = {
0xffffffffUL, 0x7fffffffUL, 0x00000000UL, 0x00000000UL
};
address MacroAssembler::L_2IL0FLOATPACKET_0 = (address)_L_2IL0FLOATPACKET_0;

1 comment on commit 57930f8

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.