Compare commits
251 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4af2585ac3 | |||
| 3041e656ce | |||
| 4b85ba9067 | |||
| 72663695da | |||
| 6d1529cd70 | |||
| 90cf3a2086 | |||
| 702179e785 | |||
| 4786f8bee5 | |||
| a3ee821f38 | |||
| 2eb0898fef | |||
| 5bf1bab5b3 | |||
| be0e49b7e2 | |||
| 449641813a | |||
| d6ca382f4e | |||
| 4ca4485e9a | |||
| 1d6cafdc52 | |||
| 9b1633ded0 | |||
| 8b1cf8eefe | |||
| 1668162319 | |||
| b83e7939dd | |||
| 551cd03b99 | |||
| f292d7c66c | |||
| 9feb8f21b5 | |||
| 0496806102 | |||
| d47e6b713c | |||
| d278043ddb | |||
| 62fa971f31 | |||
| 0db4702891 | |||
| 28460ca330 | |||
| 0af959a340 | |||
| 98e1d2fab1 | |||
| 4728f746a8 | |||
| 1605e8392e | |||
| a6f624b074 | |||
| 9b99bc8ef5 | |||
| 2dfe4586f7 | |||
| 7e29d294e5 | |||
| 376d77e8a7 | |||
| fc49a1b502 | |||
| f6d77cb332 | |||
| 5594d6bc88 | |||
| afda8ad460 | |||
| f52aed6f81 | |||
| d5a207994b | |||
| a1a37bd7b2 | |||
| 1159b53bfc | |||
| b00720edd7 | |||
| b6e5ef4ad0 | |||
| be10722436 | |||
| 5a32966d42 | |||
| f4209dff3b | |||
| 2311ec394d | |||
| 1873b45948 | |||
| 52b02edaba | |||
| d6e2d4eb1f | |||
| cd1ce5883d | |||
| 1cdd241ff3 | |||
| b73228b51c | |||
| 1992b69a47 | |||
| 501fa2041a | |||
| 37b725d9c1 | |||
| 7c75cb312c | |||
| 9891cd69e4 | |||
| 48d21b50fa | |||
| 13f460c395 | |||
| 233d3a8d43 | |||
| 005877b063 | |||
| dd410e0b77 | |||
| fd29677479 | |||
| 5bb9fed9de | |||
| 9def7bfea2 | |||
| 7e3e55a576 | |||
| 692c20ce1d | |||
| 285d16a3a3 | |||
| b37a1a33ae | |||
| af2fbd5a71 | |||
| 991f8e6f38 | |||
| 1b11bea76b | |||
| 914b44e277 | |||
| 0b81db1d38 | |||
| 5873c4b5d6 | |||
| 0e5655e668 | |||
| 1aa62dcafd | |||
| 4d0da18ab6 | |||
| 92f2ab2e1b | |||
| ac73e688b1 | |||
| 79bcc7b8ec | |||
| 927aa3f8da | |||
| 23fcbb0bad | |||
| c12f0e74a9 | |||
| 6a4c2676a6 | |||
| c66950643e | |||
| d45e65bab4 | |||
| f58e17fd27 | |||
| d27649fe22 | |||
| bd25db1fb8 | |||
| 862119565d | |||
| 2ac24bf1ba | |||
| 650fd35b3b | |||
| 4ee6079b11 | |||
| 910bb68e51 | |||
| 6bfd018bea | |||
| 7f070d356c | |||
| 6b3162620b | |||
| 1ea8cfa6dc | |||
| ebeb77baae | |||
| 4ca3ab6275 | |||
| eb835e05f9 | |||
| eb729f0aaa | |||
| 8a20656ed0 | |||
| 0f2a95c15d | |||
| a9c93f865b | |||
| 4b4d0cd35a | |||
| 9c46febcac | |||
| 6bec42adcc | |||
| aed9485bbb | |||
| c06d6805aa | |||
| 07549f3e15 | |||
| e783c524c1 | |||
| eb34a11793 | |||
| 2376a9e972 | |||
| 0f406c420e | |||
| 596af0a7cc | |||
| b6a4cfecb7 | |||
| e3320a9df5 | |||
| 2bfada3f58 | |||
| 2c114d676d | |||
| baf8bc5701 | |||
| 59e87437b4 | |||
| e6781fd949 | |||
| 069c569a71 | |||
| 85877e2022 | |||
| ba7bf43c76 | |||
| 5d9f94e05e | |||
| f740cd2aad | |||
| 76dba201fa | |||
| c3fbbfabcc | |||
| e6868c6248 | |||
| 837f634bf2 | |||
| 012e079d11 | |||
| 0e98ec3662 | |||
| 0935b76c6b | |||
| aee73d3568 | |||
| 23a65644ae | |||
| f81c7c592b | |||
| 7231916754 | |||
| 134b63f0e8 | |||
| 2e783963d2 | |||
| ebb6fd7d78 | |||
| 3790965df3 | |||
| f62b9eca08 | |||
| 854b384b12 | |||
| da7121aff9 | |||
| fa6e884105 | |||
| 3f27a03bba | |||
| 1d55adee11 | |||
| 3d113af9e3 | |||
| 5fccabff15 | |||
| 1a03a1fbb1 | |||
| 7ad9bdef1e | |||
| 5252262349 | |||
| 2c7f7380ea | |||
| 56baf64ada | |||
| cc563c87cd | |||
| 8be16160d2 | |||
| dfd383224d | |||
| 5251405ce9 | |||
| fa3af820ad | |||
| 4df41d2a75 | |||
| db6320df98 | |||
| ef724f40c1 | |||
| 6b72b77803 | |||
| e44ef0c32b | |||
| c54dcefbfd | |||
| 182fbc2b83 | |||
| c69456e87a | |||
| 3607e9986f | |||
| 5a2700f231 | |||
| 84e5d63b9f | |||
| f49849a5ed | |||
| 6c2d383492 | |||
| 1188ca55f5 | |||
| 394eb80a48 | |||
| 8c3ca024c7 | |||
| 17d8fa8e42 | |||
| 0366d8823b | |||
| 9b02896b47 | |||
| fe9dbcc496 | |||
| 07ecc93dbd | |||
| 6b4b10200e | |||
| 8cc54ec6b8 | |||
| 07ea907e4f | |||
| 444007fc23 | |||
| 8606d3f840 | |||
| 64c46d8efc | |||
| ba0a6eed1a | |||
| b19e872192 | |||
| aea71ccab7 | |||
| 586167cff5 | |||
| c0a4c0ba97 | |||
| 2746c1a555 | |||
| 89af6e13f2 | |||
| 538a722c2e | |||
| c57003c9b8 | |||
| 2f29b3f24a | |||
| 59e76af47b | |||
| 6c8e384c63 | |||
| 3d97e17a31 | |||
| aabf699dd0 | |||
| 9d71af108e | |||
| 63688d894e | |||
| 9d9c0e0670 | |||
| fdbba049a2 | |||
| 6165921449 | |||
| 08b677bba4 | |||
| 75269fdb49 | |||
| d53190ac44 | |||
| e19ec6f785 | |||
| 320230db5f | |||
| af8fb20ac0 | |||
| 9093d3a04c | |||
| 5b1ebbb271 | |||
| 37f0e74d32 | |||
| cedc0117ac | |||
| 12c0f29b97 | |||
| c6cecc581f | |||
| 62cc347242 | |||
| 556dfddac8 | |||
| bdf6853cfd | |||
| aa6ff45052 | |||
| 25abdd85c4 | |||
| 501b2b3ebc | |||
| 2360542e89 | |||
| bdb7d25ac1 | |||
| f0e1078c71 | |||
| 7bfdb01207 | |||
| a80ba6260e | |||
| b90799c0e9 | |||
| 873078028b | |||
| a663812121 | |||
| ca03080c9f | |||
| 648582ab78 | |||
| 52e777845f | |||
| 3c9fd7688f | |||
| a48538dd63 | |||
| 80cb0ead50 | |||
| 5c596e2a95 | |||
| 32ab0dbc0b | |||
| de1f5a3c43 | |||
| 741221988e | |||
| 8ca1feaf7e |
@@ -327,8 +327,8 @@ jobs:
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-x64
|
||||
runs-on: 'macos-13'
|
||||
xcode-toolset-version: '14.3.1'
|
||||
runs-on: 'macos-15-intel'
|
||||
xcode-toolset-version: '16.4'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
@@ -340,8 +340,8 @@ jobs:
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-aarch64
|
||||
runs-on: 'macos-14'
|
||||
xcode-toolset-version: '15.4'
|
||||
runs-on: 'macos-15'
|
||||
xcode-toolset-version: '16.4'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
@@ -432,9 +432,9 @@ jobs:
|
||||
with:
|
||||
platform: macos-aarch64
|
||||
bootjdk-platform: macos-aarch64
|
||||
runs-on: macos-14
|
||||
runs-on: macos-15
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
xcode-toolset-version: '15.4'
|
||||
xcode-toolset-version: '16.4'
|
||||
debug-suffix: -debug
|
||||
|
||||
test-windows-x64:
|
||||
|
||||
@@ -116,6 +116,9 @@ else ifeq ($(call isTargetOs, aix), true)
|
||||
$(eval STATIC_LIB_EXPORT_FILES += $(lib).exp) \
|
||||
)
|
||||
STATIC_LIBS := -Wl,-bexpfull $(STATIC_LIB_FILES) $(addprefix -Wl$(COMMA)-bE:, $(STATIC_LIB_EXPORT_FILES))
|
||||
ifeq ($(DEBUG_LEVEL), slowdebug)
|
||||
STATIC_LIBS += -Wl,-bbigtoc
|
||||
endif
|
||||
else
|
||||
$(error Unsupported platform)
|
||||
endif
|
||||
|
||||
@@ -363,7 +363,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
|
||||
|
||||
# Check if it's a GNU date compatible version
|
||||
AC_MSG_CHECKING([if date is a GNU compatible version])
|
||||
check_date=`$DATE --version 2>&1 | $GREP "GNU\|BusyBox"`
|
||||
check_date=`$DATE --version 2>&1 | $GREP "GNU\|BusyBox\|uutils"`
|
||||
if test "x$check_date" != x; then
|
||||
AC_MSG_RESULT([yes])
|
||||
IS_GNU_DATE=yes
|
||||
|
||||
@@ -408,27 +408,6 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
|
||||
AC_MSG_CHECKING([if Boot JDK is 32 or 64 bits])
|
||||
AC_MSG_RESULT([$BOOT_JDK_BITS])
|
||||
|
||||
# Try to enable CDS
|
||||
AC_MSG_CHECKING([for local Boot JDK Class Data Sharing (CDS)])
|
||||
BOOT_JDK_CDS_ARCHIVE=$CONFIGURESUPPORT_OUTPUTDIR/classes.jsa
|
||||
UTIL_ADD_JVM_ARG_IF_OK([-XX:+UnlockDiagnosticVMOptions -XX:-VerifySharedSpaces -XX:SharedArchiveFile=$BOOT_JDK_CDS_ARCHIVE],boot_jdk_cds_args,[$JAVA])
|
||||
|
||||
if test "x$boot_jdk_cds_args" != x; then
|
||||
# Try creating a CDS archive
|
||||
$JAVA $boot_jdk_cds_args -Xshare:dump > /dev/null 2>&1
|
||||
if test $? -eq 0; then
|
||||
BOOTJDK_USE_LOCAL_CDS=true
|
||||
AC_MSG_RESULT([yes, created])
|
||||
else
|
||||
# Generation failed, don't use CDS.
|
||||
BOOTJDK_USE_LOCAL_CDS=false
|
||||
AC_MSG_RESULT([no, creation failed])
|
||||
fi
|
||||
else
|
||||
BOOTJDK_USE_LOCAL_CDS=false
|
||||
AC_MSG_RESULT([no, -XX:SharedArchiveFile not supported])
|
||||
fi
|
||||
|
||||
BOOTJDK_SETUP_CLASSPATH
|
||||
])
|
||||
|
||||
@@ -444,13 +423,8 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
|
||||
# Force en-US environment
|
||||
UTIL_ADD_JVM_ARG_IF_OK([-Duser.language=en -Duser.country=US],boot_jdk_jvmargs,[$JAVA])
|
||||
|
||||
if test "x$BOOTJDK_USE_LOCAL_CDS" = xtrue; then
|
||||
# Use our own CDS archive
|
||||
UTIL_ADD_JVM_ARG_IF_OK([$boot_jdk_cds_args -Xshare:auto],boot_jdk_jvmargs,[$JAVA])
|
||||
else
|
||||
# Otherwise optimistically use the system-wide one, if one is present
|
||||
UTIL_ADD_JVM_ARG_IF_OK([-Xshare:auto],boot_jdk_jvmargs,[$JAVA])
|
||||
fi
|
||||
UTIL_ADD_JVM_ARG_IF_OK([-Xlog:all=off:stdout],boot_jdk_jvmargs,[$JAVA])
|
||||
UTIL_ADD_JVM_ARG_IF_OK([-Xlog:all=warning:stderr],boot_jdk_jvmargs,[$JAVA])
|
||||
|
||||
# Finally append user provided options to allow them to override.
|
||||
UTIL_ADD_JVM_ARG_IF_OK([$USER_BOOT_JDK_OPTIONS],boot_jdk_jvmargs,[$JAVA])
|
||||
|
||||
@@ -44,7 +44,3 @@ JAVAC_CMD := $(FIXPATH) $(BOOT_JDK)/bin/javac
|
||||
JAR_CMD := $(FIXPATH) $(BOOT_JDK)/bin/jar
|
||||
# The bootcycle JVM arguments may differ from the original boot jdk.
|
||||
JAVA_FLAGS_BIG := @BOOTCYCLE_JVM_ARGS_BIG@
|
||||
# Any CDS settings generated for the bootjdk are invalid in the bootcycle build.
|
||||
# By filtering out those JVM args, the bootcycle JVM will use its default
|
||||
# settings for CDS.
|
||||
JAVA_FLAGS := $(filter-out -XX:SharedArchiveFile% -Xshare%, $(JAVA_FLAGS))
|
||||
|
||||
@@ -79,7 +79,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
BASIC_LDFLAGS="-Wl,-b64 -Wl,-brtl -Wl,-bnorwexec -Wl,-blibpath:/usr/lib:lib -Wl,-bnoexpall \
|
||||
-Wl,-bernotok -Wl,-bdatapsize:64k -Wl,-btextpsize:64k -Wl,-bstackpsize:64k"
|
||||
-Wl,-bernotok -Wl,-bcdtors:mbr::s -Wl,-bdatapsize:64k -Wl,-btextpsize:64k -Wl,-bstackpsize:64k"
|
||||
BASIC_LDFLAGS_JVM_ONLY="$BASIC_LDFLAGS_JVM_ONLY -Wl,-lC_r -Wl,-bbigtoc"
|
||||
fi
|
||||
|
||||
|
||||
@@ -565,9 +565,14 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER],
|
||||
# with an additional define LLVM_SYMBOLIZER, which we set here.
|
||||
# To calculate the correct llvm_symbolizer path we can use the location of the compiler, because
|
||||
# their relation is fixed.
|
||||
# In the ubsan case we have to link every binary with the C++-compiler as linker, because inherently
|
||||
# the C-Compiler and the C++-compiler used as linker provide a different set of ubsan exports.
|
||||
# Linking an executable with the C-compiler and one of its shared libraries with the C++-compiler
|
||||
# leeds to unresolved symbols.
|
||||
if test "x$TOOLCHAIN_TYPE" = "xclang" && test "x$OPENJDK_TARGET_OS" = "xaix"; then
|
||||
UBSAN_CFLAGS="$UBSAN_CFLAGS -fno-sanitize=function,vptr -DLLVM_SYMBOLIZER=$(dirname $(dirname $CC))/tools/ibm-llvm-symbolizer"
|
||||
UBSAN_LDFLAGS="$UBSAN_LDFLAGS -fno-sanitize=function,vptr -Wl,-bbigtoc"
|
||||
UBSAN_CFLAGS="$UBSAN_CFLAGS -DLLVM_SYMBOLIZER=$(dirname $(dirname $CC))/tools/ibm-llvm-symbolizer"
|
||||
UBSAN_LDFLAGS="$UBSAN_LDFLAGS -Wl,-bbigtoc"
|
||||
LD="$LDCXX"
|
||||
fi
|
||||
UTIL_ARG_ENABLE(NAME: ubsan, DEFAULT: false, RESULT: UBSAN_ENABLED,
|
||||
DESC: [enable UndefinedBehaviorSanitizer],
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
################################################################################
|
||||
|
||||
# Minimum supported versions
|
||||
JTREG_MINIMUM_VERSION=8
|
||||
JTREG_MINIMUM_VERSION=8.1
|
||||
GTEST_MINIMUM_VERSION=1.14.0
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -136,12 +136,8 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS $LIBPTHREAD"
|
||||
fi
|
||||
|
||||
# librt for legacy clock_gettime
|
||||
# librt - for timers (timer_* functions)
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
# Hotspot needs to link librt to get the clock_* functions.
|
||||
# But once our supported minimum build and runtime platform
|
||||
# has glibc 2.17, this can be removed as the functions are
|
||||
# in libc.
|
||||
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lrt"
|
||||
fi
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ define SetupExecuteBody
|
||||
endif
|
||||
|
||||
$1_VARDEPS := $$($1_COMMAND) $$($1_PRE_COMMAND) $$($1_POST_COMMAND)
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS)
|
||||
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BASE)_exec.vardeps)
|
||||
|
||||
ifneq ($$($1_PRE_COMMAND), )
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# Versions and download locations for dependencies used by GitHub Actions (GHA)
|
||||
|
||||
GTEST_VERSION=1.14.0
|
||||
JTREG_VERSION=8+2
|
||||
JTREG_VERSION=8.1+1
|
||||
|
||||
LINUX_X64_BOOT_JDK_EXT=tar.gz
|
||||
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk24/1f9ff9062db4449d8ca828c504ffae90/36/GPL/openjdk-24_linux-x64_bin.tar.gz
|
||||
|
||||
@@ -1174,9 +1174,9 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
jtreg: {
|
||||
server: "jpg",
|
||||
product: "jtreg",
|
||||
version: "8",
|
||||
build_number: "2",
|
||||
file: "bundles/jtreg-8+2.zip",
|
||||
version: "8.1",
|
||||
build_number: "1",
|
||||
file: "bundles/jtreg-8.1+1.zip",
|
||||
environment_name: "JT_HOME",
|
||||
environment_path: input.get("jtreg", "home_path") + "/bin",
|
||||
configure_args: "--with-jtreg=" + input.get("jtreg", "home_path"),
|
||||
|
||||
@@ -32,11 +32,6 @@
|
||||
547d 92ca
|
||||
53da 9b7e
|
||||
446e f86f
|
||||
#
|
||||
# we should use this one instead of the 4260<-ff0d
|
||||
#4260 2212
|
||||
4260 ff0d
|
||||
#
|
||||
426A 00A6
|
||||
43A1 301C
|
||||
444A 2014
|
||||
|
||||
@@ -25,13 +25,6 @@
|
||||
# 4260 <--> 2212
|
||||
# 426A <--> 00A6
|
||||
#
|
||||
# Warning:
|
||||
# "our old" implementation seems agree with above "new" mappings
|
||||
# except the entries 4260 <-> 2212. To keep the "compatbility"
|
||||
# with the "old" implementation, I changed the entries "temporarily"
|
||||
# 4260 <-> 2212
|
||||
# 4260 <- ff0d
|
||||
#
|
||||
00 0000
|
||||
01 0001
|
||||
02 0002
|
||||
@@ -407,8 +400,7 @@ FF 009F
|
||||
425D FF09
|
||||
425E FF1B
|
||||
425F FFE2
|
||||
#4260 FF0D
|
||||
4260 2212
|
||||
4260 FF0D
|
||||
4261 FF0F
|
||||
426A FFE4
|
||||
426B FF0C
|
||||
|
||||
+26
-26
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2025, 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
|
||||
@@ -57,61 +57,61 @@
|
||||
|
||||
COMMA := ,
|
||||
|
||||
os := $(shell uname -o)
|
||||
cpu := $(shell uname -p)
|
||||
OS := $(shell uname -o)
|
||||
CPU := $(shell uname -m)
|
||||
|
||||
# Figure out what platform this is building on.
|
||||
me := $(cpu)-$(if $(findstring Linux,$(os)),linux-gnu)
|
||||
ME := $(CPU)-$(if $(findstring Linux,$(OS)),linux-gnu)
|
||||
|
||||
$(info Building on platform $(me))
|
||||
$(info Building on platform $(ME))
|
||||
|
||||
#
|
||||
# By default just build for the current platform, which is assumed to be Linux
|
||||
#
|
||||
ifeq ($(TARGETS), )
|
||||
platforms := $(me)
|
||||
host_platforms := $(platforms)
|
||||
PLATFORMS := $(ME)
|
||||
HOST_PLATFORMS := $(PLATFORMS)
|
||||
else
|
||||
platforms := $(subst $(COMMA), , $(TARGETS))
|
||||
host_platforms := $(me)
|
||||
PLATFORMS := $(subst $(COMMA), , $(TARGETS))
|
||||
HOST_PLATFORMS := $(ME)
|
||||
endif
|
||||
target_platforms := $(platforms)
|
||||
$(info host_platforms $(host_platforms))
|
||||
$(info target_platforms $(target_platforms))
|
||||
TARGET_PLATFORMS := $(PLATFORMS)
|
||||
$(info HOST_PLATFORMS $(HOST_PLATFORMS))
|
||||
$(info TARGET_PLATFORMS $(TARGET_PLATFORMS))
|
||||
|
||||
all compile : $(platforms)
|
||||
all compile : $(PLATFORMS)
|
||||
|
||||
ifeq ($(SKIP_ME), )
|
||||
$(foreach p,$(filter-out $(me),$(platforms)),$(eval $(p) : $$(me)))
|
||||
$(foreach p,$(filter-out $(ME),$(PLATFORMS)),$(eval $(p) : $$(ME)))
|
||||
endif
|
||||
|
||||
OUTPUT_ROOT = $(abspath ../../build/devkit)
|
||||
RESULT = $(OUTPUT_ROOT)/result
|
||||
|
||||
submakevars = HOST=$@ BUILD=$(me) RESULT=$(RESULT) OUTPUT_ROOT=$(OUTPUT_ROOT)
|
||||
SUBMAKEVARS = HOST=$@ BUILD=$(ME) RESULT=$(RESULT) OUTPUT_ROOT=$(OUTPUT_ROOT)
|
||||
|
||||
$(host_platforms) :
|
||||
$(HOST_PLATFORMS) :
|
||||
@echo 'Building compilers for $@'
|
||||
@echo 'Targets: $(target_platforms)'
|
||||
for p in $(filter $@, $(target_platforms)) $(filter-out $@, $(target_platforms)); do \
|
||||
$(MAKE) -f Tools.gmk download-rpms $(submakevars) \
|
||||
@echo 'Targets: $(TARGET_PLATFORMS)'
|
||||
for p in $(filter $@, $(TARGET_PLATFORMS)) $(filter-out $@, $(TARGET_PLATFORMS)); do \
|
||||
$(MAKE) -f Tools.gmk download-rpms $(SUBMAKEVARS) \
|
||||
TARGET=$$p PREFIX=$(RESULT)/$@-to-$$p && \
|
||||
$(MAKE) -f Tools.gmk all $(submakevars) \
|
||||
$(MAKE) -f Tools.gmk all $(SUBMAKEVARS) \
|
||||
TARGET=$$p PREFIX=$(RESULT)/$@-to-$$p && \
|
||||
$(MAKE) -f Tools.gmk ccache $(submakevars) \
|
||||
$(MAKE) -f Tools.gmk ccache $(SUBMAKEVARS) \
|
||||
TARGET=$@ PREFIX=$(RESULT)/$@-to-$$p || exit 1 ; \
|
||||
done
|
||||
@echo 'All done"'
|
||||
|
||||
today := $(shell date +%Y%m%d)
|
||||
TODAY := $(shell date +%Y%m%d)
|
||||
|
||||
define Mktar
|
||||
$(1)-to-$(2)_tar = $$(RESULT)/sdk-$(1)-to-$(2)-$$(today).tar.gz
|
||||
$(1)-to-$(2)_tar = $$(RESULT)/sdk-$(1)-to-$(2)-$$(TODAY).tar.gz
|
||||
$$($(1)-to-$(2)_tar) : PLATFORM = $(1)-to-$(2)
|
||||
TARFILES += $$($(1)-to-$(2)_tar)
|
||||
endef
|
||||
|
||||
$(foreach p,$(host_platforms),$(foreach t,$(target_platforms),$(eval $(call Mktar,$(p),$(t)))))
|
||||
$(foreach p,$(HOST_PLATFORMS),$(foreach t,$(TARGET_PLATFORMS),$(eval $(call Mktar,$(p),$(t)))))
|
||||
|
||||
tars : all $(TARFILES)
|
||||
onlytars : $(TARFILES)
|
||||
@@ -119,9 +119,9 @@ onlytars : $(TARFILES)
|
||||
$(MAKE) -r -f Tars.gmk SRC_DIR=$(RESULT)/$(PLATFORM) TAR_FILE=$@
|
||||
|
||||
clean :
|
||||
rm -rf $(addprefix ../../build/devkit/, result $(host_platforms))
|
||||
rm -rf $(addprefix ../../build/devkit/, result $(HOST_PLATFORMS))
|
||||
dist-clean: clean
|
||||
rm -rf $(addprefix ../../build/devkit/, src download)
|
||||
|
||||
FORCE :
|
||||
.PHONY : all compile tars $(configs) $(host_platforms) clean dist-clean
|
||||
.PHONY : all compile tars $(HOST_PLATFORMS) clean dist-clean
|
||||
|
||||
+109
-78
@@ -39,7 +39,7 @@
|
||||
# Fix this...
|
||||
#
|
||||
|
||||
uppercase = $(shell echo $1 | tr a-z A-Z)
|
||||
lowercase = $(shell echo $1 | tr A-Z a-z)
|
||||
|
||||
$(info TARGET=$(TARGET))
|
||||
$(info HOST=$(HOST))
|
||||
@@ -104,26 +104,48 @@ endif
|
||||
################################################################################
|
||||
# Define external dependencies
|
||||
|
||||
gcc_ver_only := 14.2.0
|
||||
binutils_ver_only := 2.43
|
||||
ccache_ver_only := 4.10.2
|
||||
GNU_BASE_URL := https://ftp.gnu.org/pub/gnu
|
||||
|
||||
BINUTILS_VER_ONLY := 2.43
|
||||
BINUTILS_BASE_URL := $(GNU_BASE_URL)/binutils
|
||||
BINUTILS_SHA512 := 93e063163e54d6a6ee2bd48dc754270bf757a3635b49a702ed6b310e929e94063958512d191e66beaf44275f7ea60865dbde138b624626739679fcc306b133bb
|
||||
|
||||
CCACHE_VER_ONLY := 4.10.2
|
||||
CCACHE_BASE_URL := https://github.com/ccache/ccache/releases/download
|
||||
CCACHE_CMAKE_BASED := 1
|
||||
mpfr_ver_only := 4.2.1
|
||||
gmp_ver_only := 6.3.0
|
||||
mpc_ver_only := 1.3.1
|
||||
gdb_ver_only := 15.2
|
||||
CCACHE_SHA512 := 3815c71d7266c32839acb306763268018acc58b3bbbd9ec79fc101e4217c1720d2ad2f01645bf69168c1c61d27700b6f3bb755cfa82689cca69824f015653f3c
|
||||
|
||||
dependencies := gcc binutils ccache mpfr gmp mpc gdb
|
||||
GCC_VER_ONLY := 14.2.0
|
||||
GCC_BASE_URL := $(GNU_BASE_URL)/gcc
|
||||
GCC_SHA512 := 932bdef0cda94bacedf452ab17f103c0cb511ff2cec55e9112fc0328cbf1d803b42595728ea7b200e0a057c03e85626f937012e49a7515bc5dd256b2bf4bc396
|
||||
|
||||
$(foreach dep,$(dependencies),$(eval $(dep)_ver := $(dep)-$($(dep)_ver_only)))
|
||||
GDB_VER_ONLY := 15.2
|
||||
GDB_BASE_URL := $(GNU_BASE_URL)/gdb
|
||||
GDB_SHA512 := 624007deceb5b15ba89c0725883d1a699fa46714ef30887f3d0165e17c5d65d634671740a135aa69e437d916218abb08cfa2a38ed309ff19d48f51da56b2a8ba
|
||||
|
||||
GCC := http://ftp.gnu.org/pub/gnu/gcc/$(gcc_ver)/$(gcc_ver).tar.xz
|
||||
BINUTILS := http://ftp.gnu.org/pub/gnu/binutils/$(binutils_ver).tar.gz
|
||||
CCACHE := https://github.com/ccache/ccache/releases/download/v$(ccache_ver_only)/$(ccache_ver).tar.xz
|
||||
MPFR := https://www.mpfr.org/$(mpfr_ver)/$(mpfr_ver).tar.bz2
|
||||
GMP := http://ftp.gnu.org/pub/gnu/gmp/$(gmp_ver).tar.bz2
|
||||
MPC := http://ftp.gnu.org/pub/gnu/mpc/$(mpc_ver).tar.gz
|
||||
GDB := http://ftp.gnu.org/gnu/gdb/$(gdb_ver).tar.xz
|
||||
GMP_VER_ONLY := 6.3.0
|
||||
GMP_BASE_URL := $(GNU_BASE_URL)/gmp
|
||||
GMP_SHA512 := e85a0dab5195889948a3462189f0e0598d331d3457612e2d3350799dba2e244316d256f8161df5219538eb003e4b5343f989aaa00f96321559063ed8c8f29fd2
|
||||
|
||||
MPC_VER_ONLY := 1.3.1
|
||||
MPC_BASE_URL := $(GNU_BASE_URL)/mpc
|
||||
MPC_SHA512 := 4bab4ef6076f8c5dfdc99d810b51108ced61ea2942ba0c1c932d624360a5473df20d32b300fc76f2ba4aa2a97e1f275c9fd494a1ba9f07c4cb2ad7ceaeb1ae97
|
||||
|
||||
MPFR_VER_ONLY := 4.2.1
|
||||
MPFR_BASE_URL := https://www.mpfr.org
|
||||
MPFR_SHA512 := bc68c0d755d5446403644833ecbb07e37360beca45f474297b5d5c40926df1efc3e2067eecffdf253f946288bcca39ca89b0613f545d46a9e767d1d4cf358475
|
||||
|
||||
DEPENDENCIES := BINUTILS CCACHE GCC GDB GMP MPC MPFR
|
||||
|
||||
$(foreach dep,$(DEPENDENCIES),$(eval $(dep)_VER := $(call lowercase,$(dep)-$($(dep)_VER_ONLY))))
|
||||
|
||||
BINUTILS_URL := $(BINUTILS_BASE_URL)/$(BINUTILS_VER).tar.xz
|
||||
CCACHE_URL := $(CCACHE_BASE_URL)/v$(CCACHE_VER_ONLY)/$(CCACHE_VER).tar.xz
|
||||
GCC_URL := $(GCC_BASE_URL)/$(GCC_VER)/$(GCC_VER).tar.xz
|
||||
GDB_URL := $(GDB_BASE_URL)/$(GDB_VER).tar.xz
|
||||
GMP_URL := $(GMP_BASE_URL)/$(GMP_VER).tar.xz
|
||||
MPC_URL := $(MPC_BASE_URL)/$(MPC_VER).tar.gz
|
||||
MPFR_URL := $(MPFR_BASE_URL)/$(MPFR_VER)/$(MPFR_VER).tar.xz
|
||||
|
||||
REQUIRED_MIN_MAKE_MAJOR_VERSION := 4
|
||||
ifneq ($(REQUIRED_MIN_MAKE_MAJOR_VERSION),)
|
||||
@@ -180,10 +202,10 @@ DOWNLOAD_RPMS := $(DOWNLOAD)/rpms/$(TARGET)-$(LINUX_VERSION)
|
||||
SRCDIR := $(OUTPUT_ROOT)/src
|
||||
|
||||
# Marker file for unpacking rpms
|
||||
rpms := $(SYSROOT)/rpms_unpacked
|
||||
RPMS := $(SYSROOT)/rpms_unpacked
|
||||
|
||||
# Need to patch libs that are linker scripts to use non-absolute paths
|
||||
libs := $(SYSROOT)/libs_patched
|
||||
LIBS := $(SYSROOT)/libs_patched
|
||||
|
||||
################################################################################
|
||||
# Download RPMs
|
||||
@@ -198,10 +220,10 @@ download-rpms:
|
||||
################################################################################
|
||||
# Unpack source packages
|
||||
|
||||
# Generate downloading + unpacking of sources.
|
||||
define Download
|
||||
# Generate downloading + checksum verification of sources.
|
||||
define DownloadVerify
|
||||
# Allow override
|
||||
$(1)_DIRNAME ?= $(basename $(basename $(notdir $($(1)))))
|
||||
$(1)_DIRNAME ?= $(basename $(basename $(notdir $($(1)_URL))))
|
||||
$(1)_DIR = $(abspath $(SRCDIR)/$$($(1)_DIRNAME))
|
||||
ifeq ($$($(1)_CMAKE_BASED),)
|
||||
$(1)_CFG = $$($(1)_DIR)/configure
|
||||
@@ -212,7 +234,7 @@ define Download
|
||||
$(1)_SRC_MARKER = $$($(1)_DIR)/CMakeLists.txt
|
||||
$(1)_CONFIG = $$(CMAKE_CONFIG) $$($(1)_DIR)
|
||||
endif
|
||||
$(1)_FILE = $(DOWNLOAD)/$(notdir $($(1)))
|
||||
$(1)_FILE = $(DOWNLOAD)/$(notdir $($(1)_URL))
|
||||
|
||||
$$($(1)_SRC_MARKER) : $$($(1)_FILE)
|
||||
mkdir -p $$(SRCDIR)
|
||||
@@ -224,11 +246,20 @@ define Download
|
||||
touch $$@
|
||||
|
||||
$$($(1)_FILE) :
|
||||
wget -P $(DOWNLOAD) $$($(1))
|
||||
mkdir -p $$(@D)
|
||||
wget -O - $$($(1)_URL) > $$@.tmp
|
||||
sha512_actual="$$$$(sha512sum $$@.tmp | awk '{ print $$$$1; }')"; \
|
||||
if [ x"$$$${sha512_actual}" != x"$$($(1)_SHA512)" ]; then \
|
||||
echo "Checksum mismatch for $$@.tmp"; \
|
||||
echo " Expected: $$($(1)_SHA512)"; \
|
||||
echo " Actual: $$$${sha512_actual}"; \
|
||||
exit 1; \
|
||||
fi
|
||||
mv $$@.tmp $$@
|
||||
endef
|
||||
|
||||
# Download and unpack all source packages
|
||||
$(foreach dep,$(dependencies),$(eval $(call Download,$(call uppercase,$(dep)))))
|
||||
$(foreach dep,$(DEPENDENCIES),$(eval $(call DownloadVerify,$(dep))))
|
||||
|
||||
################################################################################
|
||||
# Unpack RPMS
|
||||
@@ -250,7 +281,7 @@ RPM_FILE_LIST := $(sort $(foreach a, $(RPM_ARCHS), \
|
||||
# Note. For building linux you should install rpm2cpio.
|
||||
define unrpm
|
||||
$(SYSROOT)/$(notdir $(1)).unpacked : $(1)
|
||||
$$(rpms) : $(SYSROOT)/$(notdir $(1)).unpacked
|
||||
$$(RPMS) : $(SYSROOT)/$(notdir $(1)).unpacked
|
||||
endef
|
||||
|
||||
%.unpacked :
|
||||
@@ -277,7 +308,7 @@ $(foreach p,$(RPM_FILE_LIST),$(eval $(call unrpm,$(p))))
|
||||
# have it anyway, but just to make sure...
|
||||
# Patch libc.so and libpthread.so to force linking against libraries in sysroot
|
||||
# and not the ones installed on the build machine.
|
||||
$(libs) : $(rpms)
|
||||
$(LIBS) : $(RPMS)
|
||||
@echo Patching libc and pthreads
|
||||
@(for f in `find $(SYSROOT) -name libc.so -o -name libpthread.so`; do \
|
||||
(cat $$f | sed -e 's|/usr/lib64/||g' \
|
||||
@@ -293,10 +324,10 @@ $(libs) : $(rpms)
|
||||
# Create links for ffi header files so that they become visible by default when using the
|
||||
# devkit.
|
||||
ifeq ($(ARCH), x86_64)
|
||||
$(SYSROOT)/usr/include/ffi.h: $(rpms)
|
||||
$(SYSROOT)/usr/include/ffi.h: $(RPMS)
|
||||
cd $(@D) && rm -f $(@F) && ln -s ../lib/libffi-*/include/$(@F) .
|
||||
|
||||
$(SYSROOT)/usr/include/ffitarget.h: $(rpms)
|
||||
$(SYSROOT)/usr/include/ffitarget.h: $(RPMS)
|
||||
cd $(@D) && rm -f $(@F) && ln -s ../lib/libffi-*/include/$(@F) .
|
||||
|
||||
SYSROOT_LINKS += $(SYSROOT)/usr/include/ffi.h $(SYSROOT)/usr/include/ffitarget.h
|
||||
@@ -305,7 +336,7 @@ endif
|
||||
################################################################################
|
||||
|
||||
# Define marker files for each source package to be compiled
|
||||
$(foreach dep,$(dependencies),$(eval $(dep) = $(TARGETDIR)/$($(dep)_ver).done))
|
||||
$(foreach dep,$(DEPENDENCIES),$(eval $(dep) = $(TARGETDIR)/$($(dep)_VER).done))
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -345,48 +376,48 @@ TOOLS ?= $(call declare_tools,_FOR_TARGET,$(TARGET)-)
|
||||
# CFLAG_<name> to most likely -m32.
|
||||
define mk_bfd
|
||||
$$(info Libs for $(1))
|
||||
$$(BUILDDIR)/$$(binutils_ver)-$(subst /,-,$(1))/Makefile \
|
||||
$$(BUILDDIR)/$$(BINUTILS_VER)-$(subst /,-,$(1))/Makefile \
|
||||
: CFLAGS += $$(CFLAGS_$(1))
|
||||
$$(BUILDDIR)/$$(binutils_ver)-$(subst /,-,$(1))/Makefile \
|
||||
$$(BUILDDIR)/$$(BINUTILS_VER)-$(subst /,-,$(1))/Makefile \
|
||||
: LIBDIRS = --libdir=$(TARGETDIR)/$(1)
|
||||
|
||||
bfdlib += $$(TARGETDIR)/$$(binutils_ver)-$(subst /,-,$(1)).done
|
||||
bfdmakes += $$(BUILDDIR)/$$(binutils_ver)-$(subst /,-,$(1))/Makefile
|
||||
BFDLIB += $$(TARGETDIR)/$$(BINUTILS_VER)-$(subst /,-,$(1)).done
|
||||
BFDMAKES += $$(BUILDDIR)/$$(BINUTILS_VER)-$(subst /,-,$(1))/Makefile
|
||||
endef
|
||||
|
||||
# Create one set of bfds etc for each multilib arch
|
||||
$(foreach l,$(LIBDIRS),$(eval $(call mk_bfd,$(l))))
|
||||
|
||||
# Only build these two libs.
|
||||
$(bfdlib) : MAKECMD = all-libiberty all-bfd
|
||||
$(bfdlib) : INSTALLCMD = install-libiberty install-bfd
|
||||
$(BFDLIB) : MAKECMD = all-libiberty all-bfd
|
||||
$(BFDLIB) : INSTALLCMD = install-libiberty install-bfd
|
||||
|
||||
# Building targets libbfd + libiberty. HOST==TARGET, i.e not
|
||||
# for a cross env.
|
||||
$(bfdmakes) : CONFIG = --target=$(TARGET) \
|
||||
$(BFDMAKES) : CONFIG = --target=$(TARGET) \
|
||||
--host=$(TARGET) --build=$(BUILD) \
|
||||
--prefix=$(TARGETDIR) \
|
||||
--with-sysroot=$(SYSROOT) \
|
||||
$(LIBDIRS)
|
||||
|
||||
$(bfdmakes) : TOOLS = $(call declare_tools,_FOR_TARGET,$(TARGET)-) $(call declare_tools,,$(TARGET)-)
|
||||
$(BFDMAKES) : TOOLS = $(call declare_tools,_FOR_TARGET,$(TARGET)-) $(call declare_tools,,$(TARGET)-)
|
||||
|
||||
################################################################################
|
||||
|
||||
$(gcc) \
|
||||
$(binutils) \
|
||||
$(gmp) \
|
||||
$(mpfr) \
|
||||
$(mpc) \
|
||||
$(bfdmakes) \
|
||||
$(ccache) : ENVS += $(TOOLS)
|
||||
$(GCC) \
|
||||
$(BINUTILS) \
|
||||
$(GMP) \
|
||||
$(MPFR) \
|
||||
$(MPC) \
|
||||
$(BFDMAKES) \
|
||||
$(CCACHE) : ENVS += $(TOOLS)
|
||||
|
||||
# libdir to work around hateful bfd stuff installing into wrong dirs...
|
||||
# ensure we have 64 bit bfd support in the HOST library. I.e our
|
||||
# compiler on i686 will know 64 bit symbols, BUT later
|
||||
# we build just the libs again for TARGET, then with whatever the arch
|
||||
# wants.
|
||||
$(BUILDDIR)/$(binutils_ver)/Makefile : CONFIG += --enable-64-bit-bfd --libdir=$(PREFIX)/$(word 1,$(LIBDIRS))
|
||||
$(BUILDDIR)/$(BINUTILS_VER)/Makefile : CONFIG += --enable-64-bit-bfd --libdir=$(PREFIX)/$(word 1,$(LIBDIRS))
|
||||
|
||||
ifeq ($(filter $(ARCH), s390x riscv64 ppc64le), )
|
||||
# gold compiles but cannot link properly on s390x @ gcc 13.2 and Fedore 41
|
||||
@@ -397,8 +428,8 @@ endif
|
||||
|
||||
# Makefile creation. Simply run configure in build dir.
|
||||
# Setting CFLAGS to -O2 generates a much faster ld.
|
||||
$(bfdmakes) \
|
||||
$(BUILDDIR)/$(binutils_ver)/Makefile \
|
||||
$(BFDMAKES) \
|
||||
$(BUILDDIR)/$(BINUTILS_VER)/Makefile \
|
||||
: $(BINUTILS_CFG)
|
||||
$(info Configuring $@. Log in $(@D)/log.config)
|
||||
@mkdir -p $(@D)
|
||||
@@ -417,7 +448,7 @@ $(BUILDDIR)/$(binutils_ver)/Makefile \
|
||||
) > $(@D)/log.config 2>&1
|
||||
@echo 'done'
|
||||
|
||||
$(BUILDDIR)/$(mpfr_ver)/Makefile \
|
||||
$(BUILDDIR)/$(MPFR_VER)/Makefile \
|
||||
: $(MPFR_CFG)
|
||||
$(info Configuring $@. Log in $(@D)/log.config)
|
||||
@mkdir -p $(@D)
|
||||
@@ -432,7 +463,7 @@ $(BUILDDIR)/$(mpfr_ver)/Makefile \
|
||||
) > $(@D)/log.config 2>&1
|
||||
@echo 'done'
|
||||
|
||||
$(BUILDDIR)/$(gmp_ver)/Makefile \
|
||||
$(BUILDDIR)/$(GMP_VER)/Makefile \
|
||||
: $(GMP_CFG)
|
||||
$(info Configuring $@. Log in $(@D)/log.config)
|
||||
@mkdir -p $(@D)
|
||||
@@ -449,7 +480,7 @@ $(BUILDDIR)/$(gmp_ver)/Makefile \
|
||||
) > $(@D)/log.config 2>&1
|
||||
@echo 'done'
|
||||
|
||||
$(BUILDDIR)/$(mpc_ver)/Makefile \
|
||||
$(BUILDDIR)/$(MPC_VER)/Makefile \
|
||||
: $(MPC_CFG)
|
||||
$(info Configuring $@. Log in $(@D)/log.config)
|
||||
@mkdir -p $(@D)
|
||||
@@ -468,11 +499,11 @@ $(BUILDDIR)/$(mpc_ver)/Makefile \
|
||||
# Only valid if glibc target -> linux
|
||||
# proper destructor handling for c++
|
||||
ifneq (,$(findstring linux,$(TARGET)))
|
||||
$(BUILDDIR)/$(gcc_ver)/Makefile : CONFIG += --enable-__cxa_atexit
|
||||
$(BUILDDIR)/$(GCC_VER)/Makefile : CONFIG += --enable-__cxa_atexit
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH), armhfp)
|
||||
$(BUILDDIR)/$(gcc_ver)/Makefile : CONFIG += --with-float=hard
|
||||
$(BUILDDIR)/$(GCC_VER)/Makefile : CONFIG += --with-float=hard
|
||||
endif
|
||||
|
||||
ifneq ($(filter riscv64 ppc64le s390x, $(ARCH)), )
|
||||
@@ -487,7 +518,7 @@ endif
|
||||
# skip native language.
|
||||
# and link and assemble with the binutils we created
|
||||
# earlier, so --with-gnu*
|
||||
$(BUILDDIR)/$(gcc_ver)/Makefile \
|
||||
$(BUILDDIR)/$(GCC_VER)/Makefile \
|
||||
: $(GCC_CFG)
|
||||
$(info Configuring $@. Log in $(@D)/log.config)
|
||||
mkdir -p $(@D)
|
||||
@@ -509,17 +540,17 @@ $(BUILDDIR)/$(gcc_ver)/Makefile \
|
||||
@echo 'done'
|
||||
|
||||
# need binutils for gcc
|
||||
$(gcc) : $(binutils)
|
||||
$(GCC) : $(BINUTILS)
|
||||
|
||||
# as of 4.3 or so need these for doing config
|
||||
$(BUILDDIR)/$(gcc_ver)/Makefile : $(gmp) $(mpfr) $(mpc)
|
||||
$(mpfr) : $(gmp)
|
||||
$(mpc) : $(gmp) $(mpfr)
|
||||
$(BUILDDIR)/$(GCC_VER)/Makefile : $(GMP) $(MPFR) $(MPC)
|
||||
$(MPFR) : $(GMP)
|
||||
$(MPC) : $(GMP) $(MPFR)
|
||||
|
||||
################################################################################
|
||||
# Build gdb but only where host and target match
|
||||
ifeq ($(HOST), $(TARGET))
|
||||
$(BUILDDIR)/$(gdb_ver)/Makefile: $(GDB_CFG)
|
||||
$(BUILDDIR)/$(GDB_VER)/Makefile: $(GDB_CFG)
|
||||
$(info Configuring $@. Log in $(@D)/log.config)
|
||||
mkdir -p $(@D)
|
||||
( \
|
||||
@@ -532,9 +563,9 @@ ifeq ($(HOST), $(TARGET))
|
||||
) > $(@D)/log.config 2>&1
|
||||
@echo 'done'
|
||||
|
||||
$(gdb): $(gcc)
|
||||
$(GDB): $(GCC)
|
||||
else
|
||||
$(BUILDDIR)/$(gdb_ver)/Makefile:
|
||||
$(BUILDDIR)/$(GDB_VER)/Makefile:
|
||||
$(info Faking $@, not used when cross-compiling)
|
||||
mkdir -p $(@D)
|
||||
echo "install:" > $@
|
||||
@@ -543,7 +574,7 @@ endif
|
||||
|
||||
################################################################################
|
||||
# very straightforward. just build a ccache. it is only for host.
|
||||
$(BUILDDIR)/$(ccache_ver)/Makefile \
|
||||
$(BUILDDIR)/$(CCACHE_VER)/Makefile \
|
||||
: $(CCACHE_SRC_MARKER)
|
||||
$(info Configuring $@. Log in $(@D)/log.config)
|
||||
@mkdir -p $(@D)
|
||||
@@ -554,12 +585,12 @@ $(BUILDDIR)/$(ccache_ver)/Makefile \
|
||||
) > $(@D)/log.config 2>&1
|
||||
@echo 'done'
|
||||
|
||||
gccpatch = $(TARGETDIR)/gcc-patched
|
||||
GCC_PATCHED = $(TARGETDIR)/gcc-patched
|
||||
|
||||
################################################################################
|
||||
# For some reason cpp is not created as a target-compiler
|
||||
ifeq ($(HOST),$(TARGET))
|
||||
$(gccpatch) : $(gcc) link_libs
|
||||
$(GCC_PATCHED) : $(GCC) link_libs
|
||||
@echo -n 'Creating compiler symlinks...'
|
||||
@for f in cpp; do \
|
||||
if [ ! -e $(PREFIX)/bin/$(TARGET)-$$f ]; \
|
||||
@@ -587,7 +618,7 @@ ifeq ($(HOST),$(TARGET))
|
||||
done;)
|
||||
@echo 'done'
|
||||
else
|
||||
$(gccpatch) :
|
||||
$(GCC_PATCHED) :
|
||||
@echo 'done'
|
||||
endif
|
||||
|
||||
@@ -615,7 +646,7 @@ $(PREFIX)/devkit.info:
|
||||
echo '# This file describes to configure how to interpret the contents of this' >> $@
|
||||
echo '# devkit' >> $@
|
||||
echo '' >> $@
|
||||
echo 'DEVKIT_NAME="$(gcc_ver) - $(LINUX_VERSION)"' >> $@
|
||||
echo 'DEVKIT_NAME="$(GCC_VER) - $(LINUX_VERSION)"' >> $@
|
||||
echo 'DEVKIT_TOOLCHAIN_PATH="$$DEVKIT_ROOT/bin"' >> $@
|
||||
echo 'DEVKIT_SYSROOT="$$DEVKIT_ROOT/$(TARGET)/sysroot"' >> $@
|
||||
echo 'DEVKIT_EXTRA_PATH="$$DEVKIT_ROOT/bin"' >> $@
|
||||
@@ -651,32 +682,32 @@ ifeq ($(TARGET), $(HOST))
|
||||
@echo 'Creating missing $* soft link'
|
||||
ln -s $(TARGET)-$* $@
|
||||
|
||||
missing-links := $(addprefix $(PREFIX)/bin/, \
|
||||
addr2line ar as c++ c++filt dwp elfedit g++ gcc gcc-$(gcc_ver_only) gprof ld ld.bfd \
|
||||
MISSING_LINKS := $(addprefix $(PREFIX)/bin/, \
|
||||
addr2line ar as c++ c++filt dwp elfedit g++ gcc gcc-$(GCC_VER_ONLY) gprof ld ld.bfd \
|
||||
ld.gold nm objcopy objdump ranlib readelf size strings strip)
|
||||
endif
|
||||
|
||||
# Add link to work around "plugin needed to handle lto object" (JDK-8344272)
|
||||
$(PREFIX)/lib/bfd-plugins/liblto_plugin.so: $(PREFIX)/libexec/gcc/$(TARGET)/$(gcc_ver_only)/liblto_plugin.so
|
||||
$(PREFIX)/lib/bfd-plugins/liblto_plugin.so: $(PREFIX)/libexec/gcc/$(TARGET)/$(GCC_VER_ONLY)/liblto_plugin.so
|
||||
@echo 'Creating missing $(@F) soft link'
|
||||
@mkdir -p $(@D)
|
||||
ln -s $$(realpath -s --relative-to=$(@D) $<) $@
|
||||
|
||||
missing-links += $(PREFIX)/lib/bfd-plugins/liblto_plugin.so
|
||||
MISSING_LINKS += $(PREFIX)/lib/bfd-plugins/liblto_plugin.so
|
||||
|
||||
################################################################################
|
||||
|
||||
bfdlib : $(bfdlib)
|
||||
binutils : $(binutils)
|
||||
rpms : $(rpms)
|
||||
libs : $(libs)
|
||||
bfdlib : $(BFDLIB)
|
||||
binutils : $(BINUTILS)
|
||||
rpms : $(RPMS)
|
||||
libs : $(LIBS)
|
||||
sysroot : rpms libs
|
||||
gcc : sysroot $(gcc) $(gccpatch)
|
||||
gdb : $(gdb)
|
||||
all : binutils gcc bfdlib $(PREFIX)/devkit.info $(missing-links) $(SYSROOT_LINKS) \
|
||||
gcc : sysroot $(GCC) $(GCC_PATCHED)
|
||||
gdb : $(GDB)
|
||||
all : binutils gcc bfdlib $(PREFIX)/devkit.info $(MISSING_LINKS) $(SYSROOT_LINKS) \
|
||||
$(THESE_MAKEFILES) gdb
|
||||
|
||||
# this is only built for host. so separate.
|
||||
ccache : $(ccache)
|
||||
ccache : $(CCACHE)
|
||||
|
||||
.PHONY : gcc all binutils bfdlib link_libs rpms libs sysroot
|
||||
|
||||
@@ -93,7 +93,7 @@ elif test "x$TARGET_PLATFORM" = xlinux_x64; then
|
||||
rpm2cpio $OUTPUT_ROOT/m4-$M4_VERSION.el6.x86_64.rpm | cpio -d -i
|
||||
elif test "x$TARGET_PLATFORM" = xlinux_x86; then
|
||||
M4_VERSION=1.4.13-5
|
||||
wget http://yum.oracle.com/repo/OracleLinux/OL6/latest/i386/getPackage/m4-$M4_VERSION.el6.i686.rpm
|
||||
wget https://yum.oracle.com/repo/OracleLinux/OL6/latest/i386/getPackage/m4-$M4_VERSION.el6.i686.rpm
|
||||
cd $IMAGE_DIR
|
||||
rpm2cpio $OUTPUT_ROOT/m4-$M4_VERSION.el6.i686.rpm | cpio -d -i
|
||||
else
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
// Java extension
|
||||
"jdk.project.jdkhome": "{{OUTPUTDIR}}/jdk",
|
||||
"jdk.java.onSave.organizeImports": false, // prevents unnecessary changes
|
||||
"jdk.serverVmOptions": ["-Xmx2G"], // prevent out of memory
|
||||
|
||||
// Additional conventions
|
||||
"files.associations": {
|
||||
|
||||
@@ -27,7 +27,5 @@
|
||||
|
||||
DOCLINT += -Xdoclint:all/protected \
|
||||
'-Xdoclint/package:java.*,javax.*'
|
||||
COPY += .js
|
||||
CLEAN += .properties
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2025, 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. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# 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 LauncherCommon.gmk
|
||||
|
||||
################################################################################
|
||||
## Build jrunscript
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jrunscript, \
|
||||
MAIN_CLASS := com.sun.tools.script.shell.Main, \
|
||||
JAVA_ARGS := --add-modules ALL-DEFAULT, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
@@ -2568,10 +2568,6 @@ RegMask Matcher::modL_proj_mask() {
|
||||
return RegMask();
|
||||
}
|
||||
|
||||
const RegMask Matcher::method_handle_invoke_SP_save_mask() {
|
||||
return FP_REG_mask();
|
||||
}
|
||||
|
||||
bool size_fits_all_mem_uses(AddPNode* addp, int shift) {
|
||||
for (DUIterator_Fast imax, i = addp->fast_outs(imax); i < imax; i++) {
|
||||
Node* u = addp->fast_out(i);
|
||||
|
||||
@@ -383,13 +383,6 @@ LIR_Opr FrameMap::stack_pointer() {
|
||||
return FrameMap::sp_opr;
|
||||
}
|
||||
|
||||
|
||||
// JSR 292
|
||||
LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() {
|
||||
return LIR_OprFact::illegalOpr; // Not needed on aarch64
|
||||
}
|
||||
|
||||
|
||||
bool FrameMap::validate_frame() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -228,8 +228,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
|
||||
|
||||
nmethod* nm = sender_blob->as_nmethod_or_null();
|
||||
if (nm != nullptr) {
|
||||
if (nm->is_deopt_mh_entry(sender_pc) || nm->is_deopt_entry(sender_pc) ||
|
||||
nm->method()->is_method_handle_intrinsic()) {
|
||||
if (nm->is_deopt_entry(sender_pc) || nm->method()->is_method_handle_intrinsic()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -454,48 +453,6 @@ JavaThread** frame::saved_thread_address(const frame& f) {
|
||||
return thread_addr;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::verify_deopt_original_pc
|
||||
//
|
||||
// Verifies the calculated original PC of a deoptimization PC for the
|
||||
// given unextended SP.
|
||||
#ifdef ASSERT
|
||||
void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp) {
|
||||
frame fr;
|
||||
|
||||
// This is ugly but it's better than to change {get,set}_original_pc
|
||||
// to take an SP value as argument. And it's only a debugging
|
||||
// method anyway.
|
||||
fr._unextended_sp = unextended_sp;
|
||||
|
||||
address original_pc = nm->get_original_pc(&fr);
|
||||
assert(nm->insts_contains_inclusive(original_pc),
|
||||
"original PC must be in the main code section of the compiled method (or must be immediately following it)");
|
||||
}
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::adjust_unextended_sp
|
||||
#ifdef ASSERT
|
||||
void frame::adjust_unextended_sp() {
|
||||
// On aarch64, sites calling method handle intrinsics and lambda forms are treated
|
||||
// as any other call site. Therefore, no special action is needed when we are
|
||||
// returning to any of these call sites.
|
||||
|
||||
if (_cb != nullptr) {
|
||||
nmethod* sender_nm = _cb->as_nmethod_or_null();
|
||||
if (sender_nm != nullptr) {
|
||||
// If the sender PC is a deoptimization point, get the original PC.
|
||||
if (sender_nm->is_deopt_entry(_pc) ||
|
||||
sender_nm->is_deopt_mh_entry(_pc)) {
|
||||
verify_deopt_original_pc(sender_nm, _unextended_sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::sender_for_interpreter_frame
|
||||
frame frame::sender_for_interpreter_frame(RegisterMap* map) const {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -141,8 +141,6 @@
|
||||
int _offset_unextended_sp; // for use in stack-chunk frames
|
||||
};
|
||||
|
||||
void adjust_unextended_sp() NOT_DEBUG_RETURN;
|
||||
|
||||
// true means _sp value is correct and we can use it to get the sender's sp
|
||||
// of the compiled frame, otherwise, _sp value may be invalid and we can use
|
||||
// _fp to get the sender's sp if PreserveFramePointer is enabled.
|
||||
@@ -152,11 +150,6 @@
|
||||
return (intptr_t*) addr_at(offset);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
// Used in frame::sender_for_{interpreter,compiled}_frame
|
||||
static void verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp);
|
||||
#endif
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
|
||||
|
||||
@@ -116,8 +116,6 @@ inline void frame::init(intptr_t* sp, intptr_t* fp, address pc) {
|
||||
}
|
||||
|
||||
inline void frame::setup(address pc) {
|
||||
adjust_unextended_sp();
|
||||
|
||||
address original_pc = get_deopt_original_pc();
|
||||
if (original_pc != nullptr) {
|
||||
_pc = original_pc;
|
||||
@@ -223,7 +221,6 @@ inline frame::frame(intptr_t* sp, intptr_t* fp) {
|
||||
// assert(_pc != nullptr, "no pc?");
|
||||
|
||||
_cb = CodeCache::find_blob(_pc);
|
||||
adjust_unextended_sp();
|
||||
|
||||
address original_pc = get_deopt_original_pc();
|
||||
if (original_pc != nullptr) {
|
||||
|
||||
@@ -35,8 +35,6 @@ const bool CCallingConventionRequiresIntsAsLongs = false;
|
||||
|
||||
#define SUPPORTS_NATIVE_CX8
|
||||
|
||||
#define SUPPORT_MONITOR_COUNT
|
||||
|
||||
// Aarch64 was not originally defined to be multi-copy-atomic, but now
|
||||
// is. See: "Simplifying ARM Concurrency: Multicopy-atomic Axiomatic
|
||||
// and Operational Models for ARMv8"
|
||||
|
||||
@@ -39,24 +39,22 @@ public:
|
||||
// 3 - restoring an old state (javaCalls)
|
||||
|
||||
void clear(void) {
|
||||
// No hardware barriers are necessary. All members are volatile and the profiler
|
||||
// is run from a signal handler and only observers the thread its running on.
|
||||
|
||||
// clearing _last_Java_sp must be first
|
||||
_last_Java_sp = nullptr;
|
||||
OrderAccess::release();
|
||||
_last_Java_fp = nullptr;
|
||||
_last_Java_pc = nullptr;
|
||||
}
|
||||
|
||||
void copy(JavaFrameAnchor* src) {
|
||||
// In order to make sure the transition state is valid for "this"
|
||||
// No hardware barriers are necessary. All members are volatile and the profiler
|
||||
// is run from a signal handler and only observers the thread its running on.
|
||||
|
||||
// We must clear _last_Java_sp before copying the rest of the new data
|
||||
//
|
||||
// Hack Alert: Temporary bugfix for 4717480/4721647
|
||||
// To act like previous version (pd_cache_state) don't null _last_Java_sp
|
||||
// unless the value is changing
|
||||
//
|
||||
if (_last_Java_sp != src->_last_Java_sp) {
|
||||
_last_Java_sp = nullptr;
|
||||
OrderAccess::release();
|
||||
}
|
||||
_last_Java_fp = src->_last_Java_fp;
|
||||
_last_Java_pc = src->_last_Java_pc;
|
||||
|
||||
@@ -634,12 +634,13 @@ void MacroAssembler::set_last_Java_frame(Register last_java_sp,
|
||||
last_java_sp = esp;
|
||||
}
|
||||
|
||||
str(last_java_sp, Address(rthread, JavaThread::last_Java_sp_offset()));
|
||||
|
||||
// last_java_fp is optional
|
||||
if (last_java_fp->is_valid()) {
|
||||
str(last_java_fp, Address(rthread, JavaThread::last_Java_fp_offset()));
|
||||
}
|
||||
|
||||
// We must set sp last.
|
||||
str(last_java_sp, Address(rthread, JavaThread::last_Java_sp_offset()));
|
||||
}
|
||||
|
||||
void MacroAssembler::set_last_Java_frame(Register last_java_sp,
|
||||
@@ -5630,38 +5631,6 @@ void MacroAssembler::tlab_allocate(Register obj,
|
||||
bs->tlab_allocate(this, obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case);
|
||||
}
|
||||
|
||||
void MacroAssembler::inc_held_monitor_count(Register tmp) {
|
||||
Address dst(rthread, JavaThread::held_monitor_count_offset());
|
||||
#ifdef ASSERT
|
||||
ldr(tmp, dst);
|
||||
increment(tmp);
|
||||
str(tmp, dst);
|
||||
Label ok;
|
||||
tbz(tmp, 63, ok);
|
||||
STOP("assert(held monitor count underflow)");
|
||||
should_not_reach_here();
|
||||
bind(ok);
|
||||
#else
|
||||
increment(dst);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MacroAssembler::dec_held_monitor_count(Register tmp) {
|
||||
Address dst(rthread, JavaThread::held_monitor_count_offset());
|
||||
#ifdef ASSERT
|
||||
ldr(tmp, dst);
|
||||
decrement(tmp);
|
||||
str(tmp, dst);
|
||||
Label ok;
|
||||
tbz(tmp, 63, ok);
|
||||
STOP("assert(held monitor count underflow)");
|
||||
should_not_reach_here();
|
||||
bind(ok);
|
||||
#else
|
||||
decrement(dst);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MacroAssembler::verify_tlab() {
|
||||
#ifdef ASSERT
|
||||
if (UseTLAB && VerifyOops) {
|
||||
|
||||
@@ -983,9 +983,6 @@ public:
|
||||
void push_cont_fastpath(Register java_thread = rthread);
|
||||
void pop_cont_fastpath(Register java_thread = rthread);
|
||||
|
||||
void inc_held_monitor_count(Register tmp);
|
||||
void dec_held_monitor_count(Register tmp);
|
||||
|
||||
// Round up to a power of two
|
||||
void round_to(Register reg, int modulus);
|
||||
|
||||
|
||||
@@ -90,7 +90,6 @@ void Relocation::pd_set_call_destination(address x) {
|
||||
|
||||
void trampoline_stub_Relocation::pd_fix_owner_after_move() {
|
||||
NativeCall* call = nativeCall_at(owner());
|
||||
assert(call->raw_destination() == owner(), "destination should be empty");
|
||||
address trampoline = addr();
|
||||
address dest = nativeCallTrampolineStub_at(trampoline)->destination();
|
||||
if (!Assembler::reachable_from_branch_at(owner(), dest)) {
|
||||
|
||||
@@ -985,11 +985,8 @@ static void fill_continuation_entry(MacroAssembler* masm) {
|
||||
|
||||
__ ldr(rscratch1, Address(rthread, JavaThread::cont_fastpath_offset()));
|
||||
__ str(rscratch1, Address(sp, ContinuationEntry::parent_cont_fastpath_offset()));
|
||||
__ ldr(rscratch1, Address(rthread, JavaThread::held_monitor_count_offset()));
|
||||
__ str(rscratch1, Address(sp, ContinuationEntry::parent_held_monitor_count_offset()));
|
||||
|
||||
__ str(zr, Address(rthread, JavaThread::cont_fastpath_offset()));
|
||||
__ str(zr, Address(rthread, JavaThread::held_monitor_count_offset()));
|
||||
}
|
||||
|
||||
// on entry, sp points to the ContinuationEntry
|
||||
@@ -1005,50 +1002,6 @@ static void continuation_enter_cleanup(MacroAssembler* masm) {
|
||||
#endif
|
||||
__ ldr(rscratch1, Address(sp, ContinuationEntry::parent_cont_fastpath_offset()));
|
||||
__ str(rscratch1, Address(rthread, JavaThread::cont_fastpath_offset()));
|
||||
|
||||
if (CheckJNICalls) {
|
||||
// Check if this is a virtual thread continuation
|
||||
Label L_skip_vthread_code;
|
||||
__ ldrw(rscratch1, Address(sp, ContinuationEntry::flags_offset()));
|
||||
__ cbzw(rscratch1, L_skip_vthread_code);
|
||||
|
||||
// If the held monitor count is > 0 and this vthread is terminating then
|
||||
// it failed to release a JNI monitor. So we issue the same log message
|
||||
// that JavaThread::exit does.
|
||||
__ ldr(rscratch1, Address(rthread, JavaThread::jni_monitor_count_offset()));
|
||||
__ cbz(rscratch1, L_skip_vthread_code);
|
||||
|
||||
// Save return value potentially containing the exception oop in callee-saved R19.
|
||||
__ mov(r19, r0);
|
||||
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::log_jni_monitor_still_held));
|
||||
// Restore potential return value.
|
||||
__ mov(r0, r19);
|
||||
|
||||
// For vthreads we have to explicitly zero the JNI monitor count of the carrier
|
||||
// on termination. The held count is implicitly zeroed below when we restore from
|
||||
// the parent held count (which has to be zero).
|
||||
__ str(zr, Address(rthread, JavaThread::jni_monitor_count_offset()));
|
||||
|
||||
__ bind(L_skip_vthread_code);
|
||||
}
|
||||
#ifdef ASSERT
|
||||
else {
|
||||
// Check if this is a virtual thread continuation
|
||||
Label L_skip_vthread_code;
|
||||
__ ldrw(rscratch1, Address(sp, ContinuationEntry::flags_offset()));
|
||||
__ cbzw(rscratch1, L_skip_vthread_code);
|
||||
|
||||
// See comment just above. If not checking JNI calls the JNI count is only
|
||||
// needed for assertion checking.
|
||||
__ str(zr, Address(rthread, JavaThread::jni_monitor_count_offset()));
|
||||
|
||||
__ bind(L_skip_vthread_code);
|
||||
}
|
||||
#endif
|
||||
|
||||
__ ldr(rscratch1, Address(sp, ContinuationEntry::parent_held_monitor_count_offset()));
|
||||
__ str(rscratch1, Address(rthread, JavaThread::held_monitor_count_offset()));
|
||||
|
||||
__ ldr(rscratch2, Address(sp, ContinuationEntry::parent_offset()));
|
||||
__ str(rscratch2, Address(rthread, JavaThread::cont_entry_offset()));
|
||||
__ add(rfp, sp, (int)ContinuationEntry::size());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2020, Red Hat Inc. All rights reserved.
|
||||
* Copyright 2025 Arm Limited and/or its affiliates.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -222,10 +223,13 @@ void VM_Version::initialize() {
|
||||
// Neoverse
|
||||
// N1: 0xd0c
|
||||
// N2: 0xd49
|
||||
// N3: 0xd8e
|
||||
// V1: 0xd40
|
||||
// V2: 0xd4f
|
||||
// V3: 0xd84
|
||||
if (_cpu == CPU_ARM && (model_is(0xd0c) || model_is(0xd49) ||
|
||||
model_is(0xd40) || model_is(0xd4f))) {
|
||||
model_is(0xd40) || model_is(0xd4f) ||
|
||||
model_is(0xd8e) || model_is(0xd84))) {
|
||||
if (FLAG_IS_DEFAULT(UseSIMDForMemoryOps)) {
|
||||
FLAG_SET_DEFAULT(UseSIMDForMemoryOps, true);
|
||||
}
|
||||
@@ -260,7 +264,9 @@ void VM_Version::initialize() {
|
||||
// Neoverse
|
||||
// V1: 0xd40
|
||||
// V2: 0xd4f
|
||||
if (_cpu == CPU_ARM && (model_is(0xd40) || model_is(0xd4f))) {
|
||||
// V3: 0xd84
|
||||
if (_cpu == CPU_ARM &&
|
||||
(model_is(0xd40) || model_is(0xd4f) || model_is(0xd84))) {
|
||||
if (FLAG_IS_DEFAULT(UseCryptoPmullForCRC32)) {
|
||||
FLAG_SET_DEFAULT(UseCryptoPmullForCRC32, true);
|
||||
}
|
||||
|
||||
@@ -1154,10 +1154,6 @@ RegMask Matcher::modL_proj_mask() {
|
||||
return RegMask();
|
||||
}
|
||||
|
||||
const RegMask Matcher::method_handle_invoke_SP_save_mask() {
|
||||
return FP_REGP_mask();
|
||||
}
|
||||
|
||||
bool maybe_far_call(const CallNode *n) {
|
||||
return !MacroAssembler::_reachable_from_cache(n->as_Call()->entry_point());
|
||||
}
|
||||
@@ -1248,23 +1244,6 @@ encode %{
|
||||
__ set_inst_mark(mark);
|
||||
%}
|
||||
|
||||
enc_class preserve_SP %{
|
||||
// preserve mark
|
||||
address mark = __ inst_mark();
|
||||
DEBUG_ONLY(int off0 = __ offset());
|
||||
// FP is preserved across all calls, even compiled calls.
|
||||
// Use it to preserve SP in places where the callee might change the SP.
|
||||
__ mov(Rmh_SP_save, SP);
|
||||
DEBUG_ONLY(int off1 = __ offset());
|
||||
assert(off1 - off0 == 4, "correct size prediction");
|
||||
// restore mark
|
||||
__ set_inst_mark(mark);
|
||||
%}
|
||||
|
||||
enc_class restore_SP %{
|
||||
__ mov(SP, Rmh_SP_save);
|
||||
%}
|
||||
|
||||
enc_class Java_Dynamic_Call (method meth) %{
|
||||
Register R8_ic_reg = reg_to_register_object(Matcher::inline_cache_reg_encode());
|
||||
assert(R8_ic_reg == Ricklass, "should be");
|
||||
@@ -8799,7 +8778,6 @@ instruct safePoint_poll(iRegP poll, R12RegI tmp, flagsReg icc) %{
|
||||
// Call Java Static Instruction
|
||||
instruct CallStaticJavaDirect( method meth ) %{
|
||||
match(CallStaticJava);
|
||||
predicate(! ((CallStaticJavaNode*)n)->is_method_handle_invoke());
|
||||
effect(USE meth);
|
||||
|
||||
ins_cost(CALL_COST);
|
||||
@@ -8808,20 +8786,6 @@ instruct CallStaticJavaDirect( method meth ) %{
|
||||
ins_pipe(simple_call);
|
||||
%}
|
||||
|
||||
// Call Java Static Instruction (method handle version)
|
||||
instruct CallStaticJavaHandle( method meth ) %{
|
||||
match(CallStaticJava);
|
||||
predicate(((CallStaticJavaNode*)n)->is_method_handle_invoke());
|
||||
effect(USE meth);
|
||||
// FP is saved by all callees (for interpreter stack correction).
|
||||
// We use it here for a similar purpose, in {preserve,restore}_FP.
|
||||
|
||||
ins_cost(CALL_COST);
|
||||
format %{ "CALL,static/MethodHandle ==> " %}
|
||||
ins_encode( SetInstMark, preserve_SP, Java_Static_Call( meth ), restore_SP, call_epilog, ClearInstMark );
|
||||
ins_pipe(simple_call);
|
||||
%}
|
||||
|
||||
// Call Java Dynamic Instruction
|
||||
instruct CallDynamicJavaDirect( method meth ) %{
|
||||
match(CallDynamicJava);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
// Copyright (c) 2008, 2025, 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
|
||||
@@ -432,8 +432,7 @@ OptoRegPair c2::return_value(int ideal_reg) {
|
||||
|
||||
int MachCallStaticJavaNode::ret_addr_offset() {
|
||||
bool far = (_method == nullptr) ? maybe_far_call(this) : !cache_reachable();
|
||||
return ((far ? 3 : 1) + (_method_handle_invoke ? 1 : 0)) *
|
||||
NativeInstruction::instruction_size;
|
||||
return (far ? 3 : 1) * NativeInstruction::instruction_size;
|
||||
}
|
||||
|
||||
int MachCallDynamicJavaNode::ret_addr_offset() {
|
||||
|
||||
@@ -174,11 +174,6 @@ LIR_Opr FrameMap::stack_pointer() {
|
||||
return FrameMap::SP_opr;
|
||||
}
|
||||
|
||||
LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() {
|
||||
assert(Rmh_SP_save == FP, "Fix register used for saving SP for MethodHandle calls");
|
||||
return FP_opr;
|
||||
}
|
||||
|
||||
bool FrameMap::validate_frame() {
|
||||
int max_offset = in_bytes(framesize_in_bytes());
|
||||
int java_index = 0;
|
||||
|
||||
@@ -275,14 +275,6 @@ OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address targe
|
||||
}
|
||||
|
||||
|
||||
static void restore_sp_for_method_handle(StubAssembler* sasm) {
|
||||
// Restore SP from its saved reg (FP) if the exception PC is a MethodHandle call site.
|
||||
__ ldr_s32(Rtemp, Address(Rthread, JavaThread::is_method_handle_return_offset()));
|
||||
__ cmp(Rtemp, 0);
|
||||
__ mov(SP, Rmh_SP_save, ne);
|
||||
}
|
||||
|
||||
|
||||
OopMapSet* Runtime1::generate_handle_exception(StubId id, StubAssembler* sasm) {
|
||||
__ block_comment("generate_handle_exception");
|
||||
|
||||
@@ -339,7 +331,6 @@ OopMapSet* Runtime1::generate_handle_exception(StubId id, StubAssembler* sasm) {
|
||||
break;
|
||||
case StubId::c1_handle_exception_from_callee_id:
|
||||
restore_live_registers_without_return(sasm); // must not jump immediately to handler
|
||||
restore_sp_for_method_handle(sasm);
|
||||
__ ret();
|
||||
break;
|
||||
default: ShouldNotReachHere();
|
||||
@@ -372,9 +363,6 @@ void Runtime1::generate_unwind_exception(StubAssembler* sasm) {
|
||||
// Jump to handler
|
||||
__ verify_not_null_oop(Rexception_obj);
|
||||
|
||||
// JSR292 extension
|
||||
restore_sp_for_method_handle(sasm);
|
||||
|
||||
__ jump(R0);
|
||||
}
|
||||
|
||||
|
||||
@@ -329,56 +329,6 @@ JavaThread** frame::saved_thread_address(const frame& f) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::verify_deopt_original_pc
|
||||
//
|
||||
// Verifies the calculated original PC of a deoptimization PC for the
|
||||
// given unextended SP. The unextended SP might also be the saved SP
|
||||
// for MethodHandle call sites.
|
||||
#ifdef ASSERT
|
||||
void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return) {
|
||||
frame fr;
|
||||
|
||||
// This is ugly but it's better than to change {get,set}_original_pc
|
||||
// to take an SP value as argument. And it's only a debugging
|
||||
// method anyway.
|
||||
fr._unextended_sp = unextended_sp;
|
||||
|
||||
address original_pc = nm->get_original_pc(&fr);
|
||||
assert(nm->insts_contains_inclusive(original_pc),
|
||||
"original PC must be in the main code section of the compiled method (or must be immediately following it)");
|
||||
assert(nm->is_method_handle_return(original_pc) == is_method_handle_return, "must be");
|
||||
}
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::adjust_unextended_sp
|
||||
void frame::adjust_unextended_sp() {
|
||||
// same as on x86
|
||||
|
||||
// If we are returning to a compiled MethodHandle call site, the
|
||||
// saved_fp will in fact be a saved value of the unextended SP. The
|
||||
// simplest way to tell whether we are returning to such a call site
|
||||
// is as follows:
|
||||
|
||||
nmethod* sender_nm = (_cb == nullptr) ? nullptr : _cb->as_nmethod_or_null();
|
||||
if (sender_nm != nullptr) {
|
||||
// If the sender PC is a deoptimization point, get the original
|
||||
// PC. For MethodHandle call site the unextended_sp is stored in
|
||||
// saved_fp.
|
||||
if (sender_nm->is_deopt_mh_entry(_pc)) {
|
||||
DEBUG_ONLY(verify_deopt_mh_original_pc(sender_nm, _fp));
|
||||
_unextended_sp = _fp;
|
||||
}
|
||||
else if (sender_nm->is_deopt_entry(_pc)) {
|
||||
DEBUG_ONLY(verify_deopt_original_pc(sender_nm, _unextended_sp));
|
||||
}
|
||||
else if (sender_nm->is_method_handle_return(_pc)) {
|
||||
_unextended_sp = _fp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::update_map_with_saved_link
|
||||
void frame::update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2025, 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
|
||||
@@ -85,20 +85,11 @@
|
||||
// original sp.
|
||||
|
||||
intptr_t* _unextended_sp;
|
||||
void adjust_unextended_sp();
|
||||
|
||||
intptr_t* ptr_at_addr(int offset) const {
|
||||
return (intptr_t*) addr_at(offset);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
// Used in frame::sender_for_{interpreter,compiled}_frame
|
||||
static void verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return = false);
|
||||
static void verify_deopt_mh_original_pc(nmethod* nm, intptr_t* unextended_sp) {
|
||||
verify_deopt_original_pc(nm, unextended_sp, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2025, 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
|
||||
@@ -112,8 +112,6 @@ inline void frame::init(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, add
|
||||
}
|
||||
|
||||
inline void frame::setup(address pc) {
|
||||
adjust_unextended_sp();
|
||||
|
||||
address original_pc = get_deopt_original_pc();
|
||||
if (original_pc != nullptr) {
|
||||
_pc = original_pc;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2025, 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
|
||||
@@ -364,7 +364,6 @@ class VFPSystemRegisterImpl : public AbstractRegisterImpl {
|
||||
// This does not seem to conflict with Rexception_pc
|
||||
// In case of issues, R3 might be OK but adapters calling the runtime would have to save it
|
||||
#define R5_mh R5 // MethodHandle register, used during the call setup
|
||||
#define Rmh_SP_save FP // for C1
|
||||
|
||||
/*
|
||||
* C++ Interpreter Register Defines
|
||||
|
||||
@@ -264,11 +264,6 @@ ExceptionBlob* OptoRuntime::generate_exception_blob() {
|
||||
|
||||
__ raw_pop(FP, LR);
|
||||
|
||||
// Restore SP from its saved reg (FP) if the exception PC is a MethodHandle call site.
|
||||
__ ldr(Rtemp, Address(Rthread, JavaThread::is_method_handle_return_offset()));
|
||||
__ cmp(Rtemp, 0);
|
||||
__ mov(SP, Rmh_SP_save, ne);
|
||||
|
||||
// R0 contains handler address
|
||||
// Since this may be the deopt blob we must set R5 to look like we returned
|
||||
// from the original pc that threw the exception
|
||||
|
||||
@@ -374,15 +374,6 @@ LIR_Opr FrameMap::stack_pointer() {
|
||||
return SP_opr;
|
||||
}
|
||||
|
||||
|
||||
// JSR 292
|
||||
// On PPC64, there is no need to save the SP, because neither
|
||||
// method handle intrinsics, nor compiled lambda forms modify it.
|
||||
LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() {
|
||||
return LIR_OprFact::illegalOpr;
|
||||
}
|
||||
|
||||
|
||||
bool FrameMap::validate_frame() {
|
||||
int max_offset = in_bytes(framesize_in_bytes());
|
||||
int java_index = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2016 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -43,8 +43,6 @@ const bool CCallingConventionRequiresIntsAsLongs = true;
|
||||
|
||||
#define SUPPORTS_NATIVE_CX8
|
||||
|
||||
#define SUPPORT_MONITOR_COUNT
|
||||
|
||||
// PPC64 is not specified as multi-copy-atomic
|
||||
// So we must not #define CPU_MULTI_COPY_ATOMIC
|
||||
|
||||
|
||||
@@ -402,7 +402,7 @@ void NativePostCallNop::make_deopt() {
|
||||
bool NativePostCallNop::patch(int32_t oopmap_slot, int32_t cb_offset) {
|
||||
int32_t i2, i1;
|
||||
assert(is_aligned(cb_offset, 4), "cb offset alignment does not match instruction alignment");
|
||||
assert(!decode(i1, i2), "already patched");
|
||||
assert(!decode(i1, i2) || NMethodRelocation, "already patched");
|
||||
|
||||
cb_offset = cb_offset >> 2;
|
||||
if (((oopmap_slot & ppc_oopmap_slot_mask) != oopmap_slot) || ((cb_offset & ppc_cb_offset_mask) != cb_offset)) {
|
||||
|
||||
@@ -2473,10 +2473,6 @@ RegMask Matcher::modL_proj_mask() {
|
||||
return RegMask();
|
||||
}
|
||||
|
||||
const RegMask Matcher::method_handle_invoke_SP_save_mask() {
|
||||
return RegMask();
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
//----------ENCODING BLOCK-----------------------------------------------------
|
||||
@@ -3434,7 +3430,6 @@ encode %{
|
||||
|
||||
// Create the call node.
|
||||
CallDynamicJavaDirectSchedNode *call = new CallDynamicJavaDirectSchedNode();
|
||||
call->_method_handle_invoke = _method_handle_invoke;
|
||||
call->_vtable_index = _vtable_index;
|
||||
call->_method = _method;
|
||||
call->_optimized_virtual = _optimized_virtual;
|
||||
|
||||
@@ -1639,7 +1639,6 @@ static void fill_continuation_entry(MacroAssembler* masm, Register reg_cont_obj,
|
||||
assert_different_registers(reg_cont_obj, reg_flags);
|
||||
Register zero = R8_ARG6;
|
||||
Register tmp2 = R9_ARG7;
|
||||
Register tmp3 = R10_ARG8;
|
||||
|
||||
DEBUG_ONLY(__ block_comment("fill {"));
|
||||
#ifdef ASSERT
|
||||
@@ -1655,12 +1654,9 @@ static void fill_continuation_entry(MacroAssembler* masm, Register reg_cont_obj,
|
||||
__ stw(zero, in_bytes(ContinuationEntry::pin_count_offset()), R1_SP);
|
||||
|
||||
__ ld_ptr(tmp2, JavaThread::cont_fastpath_offset(), R16_thread);
|
||||
__ ld(tmp3, in_bytes(JavaThread::held_monitor_count_offset()), R16_thread);
|
||||
__ st_ptr(tmp2, ContinuationEntry::parent_cont_fastpath_offset(), R1_SP);
|
||||
__ std(tmp3, in_bytes(ContinuationEntry::parent_held_monitor_count_offset()), R1_SP);
|
||||
|
||||
__ st_ptr(zero, JavaThread::cont_fastpath_offset(), R16_thread);
|
||||
__ std(zero, in_bytes(JavaThread::held_monitor_count_offset()), R16_thread);
|
||||
DEBUG_ONLY(__ block_comment("} fill"));
|
||||
}
|
||||
|
||||
@@ -1681,7 +1677,6 @@ static void fill_continuation_entry(MacroAssembler* masm, Register reg_cont_obj,
|
||||
static void continuation_enter_cleanup(MacroAssembler* masm) {
|
||||
Register tmp1 = R8_ARG6;
|
||||
Register tmp2 = R9_ARG7;
|
||||
Register tmp3 = R10_ARG8;
|
||||
|
||||
#ifdef ASSERT
|
||||
__ block_comment("clean {");
|
||||
@@ -1692,57 +1687,8 @@ static void continuation_enter_cleanup(MacroAssembler* masm) {
|
||||
|
||||
__ ld_ptr(tmp1, ContinuationEntry::parent_cont_fastpath_offset(), R1_SP);
|
||||
__ st_ptr(tmp1, JavaThread::cont_fastpath_offset(), R16_thread);
|
||||
|
||||
if (CheckJNICalls) {
|
||||
// Check if this is a virtual thread continuation
|
||||
Label L_skip_vthread_code;
|
||||
__ lwz(R0, in_bytes(ContinuationEntry::flags_offset()), R1_SP);
|
||||
__ cmpwi(CR0, R0, 0);
|
||||
__ beq(CR0, L_skip_vthread_code);
|
||||
|
||||
// If the held monitor count is > 0 and this vthread is terminating then
|
||||
// it failed to release a JNI monitor. So we issue the same log message
|
||||
// that JavaThread::exit does.
|
||||
__ ld(R0, in_bytes(JavaThread::jni_monitor_count_offset()), R16_thread);
|
||||
__ cmpdi(CR0, R0, 0);
|
||||
__ beq(CR0, L_skip_vthread_code);
|
||||
|
||||
// Save return value potentially containing the exception oop
|
||||
Register ex_oop = R15_esp; // nonvolatile register
|
||||
__ mr(ex_oop, R3_RET);
|
||||
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::log_jni_monitor_still_held));
|
||||
// Restore potental return value
|
||||
__ mr(R3_RET, ex_oop);
|
||||
|
||||
// For vthreads we have to explicitly zero the JNI monitor count of the carrier
|
||||
// on termination. The held count is implicitly zeroed below when we restore from
|
||||
// the parent held count (which has to be zero).
|
||||
__ li(tmp1, 0);
|
||||
__ std(tmp1, in_bytes(JavaThread::jni_monitor_count_offset()), R16_thread);
|
||||
|
||||
__ bind(L_skip_vthread_code);
|
||||
}
|
||||
#ifdef ASSERT
|
||||
else {
|
||||
// Check if this is a virtual thread continuation
|
||||
Label L_skip_vthread_code;
|
||||
__ lwz(R0, in_bytes(ContinuationEntry::flags_offset()), R1_SP);
|
||||
__ cmpwi(CR0, R0, 0);
|
||||
__ beq(CR0, L_skip_vthread_code);
|
||||
|
||||
// See comment just above. If not checking JNI calls the JNI count is only
|
||||
// needed for assertion checking.
|
||||
__ li(tmp1, 0);
|
||||
__ std(tmp1, in_bytes(JavaThread::jni_monitor_count_offset()), R16_thread);
|
||||
|
||||
__ bind(L_skip_vthread_code);
|
||||
}
|
||||
#endif
|
||||
|
||||
__ ld(tmp2, in_bytes(ContinuationEntry::parent_held_monitor_count_offset()), R1_SP);
|
||||
__ ld_ptr(tmp3, ContinuationEntry::parent_offset(), R1_SP);
|
||||
__ std(tmp2, in_bytes(JavaThread::held_monitor_count_offset()), R16_thread);
|
||||
__ st_ptr(tmp3, JavaThread::cont_entry_offset(), R16_thread);
|
||||
__ ld_ptr(tmp2, ContinuationEntry::parent_offset(), R1_SP);
|
||||
__ st_ptr(tmp2, JavaThread::cont_entry_offset(), R16_thread);
|
||||
DEBUG_ONLY(__ block_comment("} clean"));
|
||||
}
|
||||
|
||||
|
||||
@@ -914,6 +914,17 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
static uint32_t encode_csrrw(Register Rd, const uint32_t csr, Register Rs1) {
|
||||
guarantee(is_uimm12(csr), "csr is invalid");
|
||||
uint32_t insn = 0;
|
||||
patch((address)&insn, 6, 0, 0b1110011);
|
||||
patch((address)&insn, 14, 12, 0b001);
|
||||
patch_reg((address)&insn, 7, Rd);
|
||||
patch_reg((address)&insn, 15, Rs1);
|
||||
patch((address)&insn, 31, 20, csr);
|
||||
return insn;
|
||||
}
|
||||
|
||||
static uint32_t encode_jal(Register Rd, const int32_t offset) {
|
||||
guarantee(is_simm21(offset) && ((offset % 2) == 0), "offset is invalid.");
|
||||
uint32_t insn = 0;
|
||||
@@ -3693,19 +3704,15 @@ public:
|
||||
// --------------------------
|
||||
// Upper Immediate Instruction
|
||||
// --------------------------
|
||||
#define INSN(NAME) \
|
||||
void NAME(Register Rd, int32_t imm) { \
|
||||
/* lui -> c.lui */ \
|
||||
if (do_compress() && (Rd != x0 && Rd != x2 && imm != 0 && is_simm18(imm))) { \
|
||||
c_lui(Rd, imm); \
|
||||
return; \
|
||||
} \
|
||||
_lui(Rd, imm); \
|
||||
void lui(Register Rd, int32_t imm) {
|
||||
/* lui -> c.lui */
|
||||
if (do_compress() && (Rd != x0 && Rd != x2 && imm != 0 && is_simm18(imm))) {
|
||||
c_lui(Rd, imm);
|
||||
return;
|
||||
}
|
||||
_lui(Rd, imm);
|
||||
}
|
||||
|
||||
INSN(lui);
|
||||
|
||||
#undef INSN
|
||||
|
||||
// Cache Management Operations
|
||||
// These instruction may be turned off for user space.
|
||||
|
||||
@@ -377,11 +377,6 @@ LIR_Opr FrameMap::stack_pointer() {
|
||||
return FrameMap::sp_opr;
|
||||
}
|
||||
|
||||
// JSR 292
|
||||
LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() {
|
||||
return LIR_OprFact::illegalOpr; // Not needed on riscv
|
||||
}
|
||||
|
||||
bool FrameMap::validate_frame() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1350,6 +1350,7 @@ void LIR_Assembler::align_call(LIR_Code code) {
|
||||
}
|
||||
|
||||
void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) {
|
||||
Assembler::IncompressibleScope scope(_masm);
|
||||
address call = __ reloc_call(Address(op->addr(), rtype));
|
||||
if (call == nullptr) {
|
||||
bailout("reloc call address stub overflow");
|
||||
@@ -1360,6 +1361,7 @@ void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) {
|
||||
}
|
||||
|
||||
void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
|
||||
Assembler::IncompressibleScope scope(_masm);
|
||||
address call = __ ic_call(op->addr());
|
||||
if (call == nullptr) {
|
||||
bailout("reloc call address stub overflow");
|
||||
@@ -1842,6 +1844,10 @@ void LIR_Assembler::leal(LIR_Opr addr, LIR_Opr dest, LIR_PatchCode patch_code, C
|
||||
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");
|
||||
|
||||
Assembler::IncompressibleScope scope(_masm);
|
||||
// Post call nops must be natural aligned due to cmodx rules.
|
||||
align_call(lir_rtcall);
|
||||
|
||||
__ rt_call(dest);
|
||||
|
||||
if (info != nullptr) {
|
||||
|
||||
@@ -1687,6 +1687,7 @@ void C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register res
|
||||
Register tmp4, Register tmp5, Register tmp6,
|
||||
BasicType eltype)
|
||||
{
|
||||
assert(!UseRVV, "sanity");
|
||||
assert_different_registers(ary, cnt, result, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, t0, t1);
|
||||
|
||||
const int elsize = arrays_hashcode_elsize(eltype);
|
||||
@@ -1759,29 +1760,143 @@ void C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register res
|
||||
BLOCK_COMMENT("} // arrays_hashcode");
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::arrays_hashcode_v(Register ary, Register cnt, Register result,
|
||||
Register tmp1, Register tmp2, Register tmp3,
|
||||
BasicType eltype)
|
||||
{
|
||||
assert(UseRVV, "sanity");
|
||||
assert(StubRoutines::riscv::arrays_hashcode_powers_of_31() != nullptr, "sanity");
|
||||
assert_different_registers(ary, cnt, result, tmp1, tmp2, tmp3, t0, t1);
|
||||
|
||||
// The MaxVectorSize should have been set by detecting RVV max vector register
|
||||
// size when check UseRVV (i.e. MaxVectorSize == VM_Version::_initial_vector_length).
|
||||
// Let's use T_INT as all hashCode calculations eventually deal with ints.
|
||||
const int lmul = 2;
|
||||
const int stride = MaxVectorSize / sizeof(jint) * lmul;
|
||||
|
||||
const int elsize_bytes = arrays_hashcode_elsize(eltype);
|
||||
const int elsize_shift = exact_log2(elsize_bytes);
|
||||
|
||||
switch (eltype) {
|
||||
case T_BOOLEAN: BLOCK_COMMENT("arrays_hashcode_v(unsigned byte) {"); break;
|
||||
case T_CHAR: BLOCK_COMMENT("arrays_hashcode_v(char) {"); break;
|
||||
case T_BYTE: BLOCK_COMMENT("arrays_hashcode_v(byte) {"); break;
|
||||
case T_SHORT: BLOCK_COMMENT("arrays_hashcode_v(short) {"); break;
|
||||
case T_INT: BLOCK_COMMENT("arrays_hashcode_v(int) {"); break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
const Register pow31_highest = tmp1;
|
||||
const Register ary_end = tmp2;
|
||||
const Register consumed = tmp3;
|
||||
|
||||
const VectorRegister v_sum = v2;
|
||||
const VectorRegister v_src = v4;
|
||||
const VectorRegister v_coeffs = v6;
|
||||
const VectorRegister v_tmp = v8;
|
||||
|
||||
const address adr_pows31 = StubRoutines::riscv::arrays_hashcode_powers_of_31()
|
||||
+ sizeof(jint);
|
||||
Label VEC_LOOP, DONE, SCALAR_TAIL, SCALAR_TAIL_LOOP;
|
||||
|
||||
// NB: at this point (a) 'result' already has some value,
|
||||
// (b) 'cnt' is not 0 or 1, see java code for details.
|
||||
|
||||
andi(t0, cnt, ~(stride - 1));
|
||||
beqz(t0, SCALAR_TAIL);
|
||||
|
||||
la(t1, ExternalAddress(adr_pows31));
|
||||
lw(pow31_highest, Address(t1, -1 * sizeof(jint)));
|
||||
|
||||
vsetvli(consumed, cnt, Assembler::e32, Assembler::m2);
|
||||
vle32_v(v_coeffs, t1); // 31^^(stride - 1) ... 31^^0
|
||||
vmv_v_x(v_sum, x0);
|
||||
|
||||
bind(VEC_LOOP);
|
||||
arrays_hashcode_elload_v(v_src, v_tmp, ary, eltype);
|
||||
vmul_vv(v_src, v_src, v_coeffs);
|
||||
vmadd_vx(v_sum, pow31_highest, v_src);
|
||||
mulw(result, result, pow31_highest);
|
||||
shadd(ary, consumed, ary, t0, elsize_shift);
|
||||
subw(cnt, cnt, consumed);
|
||||
andi(t1, cnt, ~(stride - 1));
|
||||
bnez(t1, VEC_LOOP);
|
||||
|
||||
vmv_s_x(v_tmp, x0);
|
||||
vredsum_vs(v_sum, v_sum, v_tmp);
|
||||
vmv_x_s(t0, v_sum);
|
||||
addw(result, result, t0);
|
||||
beqz(cnt, DONE);
|
||||
|
||||
bind(SCALAR_TAIL);
|
||||
shadd(ary_end, cnt, ary, t0, elsize_shift);
|
||||
|
||||
bind(SCALAR_TAIL_LOOP);
|
||||
arrays_hashcode_elload(t0, Address(ary), eltype);
|
||||
slli(t1, result, 5); // optimize 31 * result
|
||||
subw(result, t1, result); // with result<<5 - result
|
||||
addw(result, result, t0);
|
||||
addi(ary, ary, elsize_bytes);
|
||||
bne(ary, ary_end, SCALAR_TAIL_LOOP);
|
||||
|
||||
bind(DONE);
|
||||
BLOCK_COMMENT("} // arrays_hashcode_v");
|
||||
}
|
||||
|
||||
int C2_MacroAssembler::arrays_hashcode_elsize(BasicType eltype) {
|
||||
switch (eltype) {
|
||||
case T_BOOLEAN: return sizeof(jboolean);
|
||||
case T_BYTE: return sizeof(jbyte);
|
||||
case T_SHORT: return sizeof(jshort);
|
||||
case T_CHAR: return sizeof(jchar);
|
||||
case T_INT: return sizeof(jint);
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
return -1;
|
||||
case T_BOOLEAN: return sizeof(jboolean);
|
||||
case T_BYTE: return sizeof(jbyte);
|
||||
case T_SHORT: return sizeof(jshort);
|
||||
case T_CHAR: return sizeof(jchar);
|
||||
case T_INT: return sizeof(jint);
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::arrays_hashcode_elload(Register dst, Address src, BasicType eltype) {
|
||||
switch (eltype) {
|
||||
// T_BOOLEAN used as surrogate for unsigned byte
|
||||
case T_BOOLEAN: lbu(dst, src); break;
|
||||
case T_BYTE: lb(dst, src); break;
|
||||
case T_SHORT: lh(dst, src); break;
|
||||
case T_CHAR: lhu(dst, src); break;
|
||||
case T_INT: lw(dst, src); break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
// T_BOOLEAN used as surrogate for unsigned byte
|
||||
case T_BOOLEAN: lbu(dst, src); break;
|
||||
case T_BYTE: lb(dst, src); break;
|
||||
case T_SHORT: lh(dst, src); break;
|
||||
case T_CHAR: lhu(dst, src); break;
|
||||
case T_INT: lw(dst, src); break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::arrays_hashcode_elload_v(VectorRegister vdst,
|
||||
VectorRegister vtmp,
|
||||
Register src,
|
||||
BasicType eltype) {
|
||||
assert_different_registers(vdst, vtmp);
|
||||
switch (eltype) {
|
||||
case T_BOOLEAN:
|
||||
vle8_v(vtmp, src);
|
||||
vzext_vf4(vdst, vtmp);
|
||||
break;
|
||||
case T_BYTE:
|
||||
vle8_v(vtmp, src);
|
||||
vsext_vf4(vdst, vtmp);
|
||||
break;
|
||||
case T_CHAR:
|
||||
vle16_v(vtmp, src);
|
||||
vzext_vf2(vdst, vtmp);
|
||||
break;
|
||||
case T_SHORT:
|
||||
vle16_v(vtmp, src);
|
||||
vsext_vf2(vdst, vtmp);
|
||||
break;
|
||||
case T_INT:
|
||||
vle32_v(vdst, src);
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,11 +92,15 @@
|
||||
Register tmp3, Register tmp4,
|
||||
Register tmp5, Register tmp6,
|
||||
BasicType eltype);
|
||||
|
||||
// helper function for arrays_hashcode
|
||||
int arrays_hashcode_elsize(BasicType eltype);
|
||||
void arrays_hashcode_elload(Register dst, Address src, BasicType eltype);
|
||||
|
||||
void arrays_hashcode_v(Register ary, Register cnt, Register result,
|
||||
Register tmp1, Register tmp2, Register tmp3,
|
||||
BasicType eltype);
|
||||
void arrays_hashcode_elload_v(VectorRegister vdst, VectorRegister vtmp,
|
||||
Register src, BasicType eltype);
|
||||
|
||||
void string_equals(Register r1, Register r2,
|
||||
Register result, Register cnt1);
|
||||
|
||||
|
||||
@@ -217,8 +217,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
|
||||
|
||||
nmethod* nm = sender_blob->as_nmethod_or_null();
|
||||
if (nm != nullptr) {
|
||||
if (nm->is_deopt_mh_entry(sender_pc) || nm->is_deopt_entry(sender_pc) ||
|
||||
nm->method()->is_method_handle_intrinsic()) {
|
||||
if (nm->is_deopt_entry(sender_pc) || nm->method()->is_method_handle_intrinsic()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -427,49 +426,6 @@ JavaThread** frame::saved_thread_address(const frame& f) {
|
||||
return thread_addr;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::verify_deopt_original_pc
|
||||
//
|
||||
// Verifies the calculated original PC of a deoptimization PC for the
|
||||
// given unextended SP.
|
||||
#ifdef ASSERT
|
||||
void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp) {
|
||||
frame fr;
|
||||
|
||||
// This is ugly but it's better than to change {get,set}_original_pc
|
||||
// to take an SP value as argument. And it's only a debugging
|
||||
// method anyway.
|
||||
fr._unextended_sp = unextended_sp;
|
||||
|
||||
assert_cond(nm != nullptr);
|
||||
address original_pc = nm->get_original_pc(&fr);
|
||||
assert(nm->insts_contains_inclusive(original_pc),
|
||||
"original PC must be in the main code section of the compiled method (or must be immediately following it)");
|
||||
}
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::adjust_unextended_sp
|
||||
#ifdef ASSERT
|
||||
void frame::adjust_unextended_sp() {
|
||||
// On riscv, sites calling method handle intrinsics and lambda forms are treated
|
||||
// as any other call site. Therefore, no special action is needed when we are
|
||||
// returning to any of these call sites.
|
||||
|
||||
if (_cb != nullptr) {
|
||||
nmethod* sender_nm = _cb->as_nmethod_or_null();
|
||||
if (sender_nm != nullptr) {
|
||||
// If the sender PC is a deoptimization point, get the original PC.
|
||||
if (sender_nm->is_deopt_entry(_pc) ||
|
||||
sender_nm->is_deopt_mh_entry(_pc)) {
|
||||
verify_deopt_original_pc(sender_nm, _unextended_sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::sender_for_interpreter_frame
|
||||
frame frame::sender_for_interpreter_frame(RegisterMap* map) const {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -179,17 +179,10 @@
|
||||
int _offset_unextended_sp; // for use in stack-chunk frames
|
||||
};
|
||||
|
||||
void adjust_unextended_sp() NOT_DEBUG_RETURN;
|
||||
|
||||
intptr_t* ptr_at_addr(int offset) const {
|
||||
return (intptr_t*) addr_at(offset);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
// Used in frame::sender_for_{interpreter,compiled}_frame
|
||||
static void verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp);
|
||||
#endif
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@@ -114,8 +114,6 @@ inline void frame::init(intptr_t* ptr_sp, intptr_t* ptr_fp, address pc) {
|
||||
}
|
||||
|
||||
inline void frame::setup(address pc) {
|
||||
adjust_unextended_sp();
|
||||
|
||||
address original_pc = get_deopt_original_pc();
|
||||
if (original_pc != nullptr) {
|
||||
_pc = original_pc;
|
||||
@@ -215,7 +213,6 @@ inline frame::frame(intptr_t* ptr_sp, intptr_t* ptr_fp) {
|
||||
// value.
|
||||
|
||||
_cb = CodeCache::find_blob(_pc);
|
||||
adjust_unextended_sp();
|
||||
|
||||
address original_pc = get_deopt_original_pc();
|
||||
if (original_pc != nullptr) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@@ -44,8 +44,6 @@ const bool CCallingConventionRequiresIntsAsLongs = false;
|
||||
|
||||
#define SUPPORTS_NATIVE_CX8
|
||||
|
||||
#define SUPPORT_MONITOR_COUNT
|
||||
|
||||
#define SUPPORT_RESERVED_STACK_AREA
|
||||
|
||||
#define USE_POINTERS_TO_REGISTER_IMPL_ARRAY
|
||||
|
||||
@@ -39,25 +39,23 @@ public:
|
||||
// 3 - restoring an old state (javaCalls)
|
||||
|
||||
void clear(void) {
|
||||
// No hardware barriers are necessary. All members are volatile and the profiler
|
||||
// is run from a signal handler and the only observer is the thread its running on.
|
||||
|
||||
// clearing _last_Java_sp must be first
|
||||
_last_Java_sp = nullptr;
|
||||
OrderAccess::release();
|
||||
_last_Java_fp = nullptr;
|
||||
_last_Java_pc = nullptr;
|
||||
}
|
||||
|
||||
void copy(JavaFrameAnchor* src) {
|
||||
// In order to make sure the transition state is valid for "this"
|
||||
// No hardware barriers are necessary. All members are volatile and the profiler
|
||||
// is run from a signal handler and the only observer is the thread its running on.
|
||||
|
||||
// We must clear _last_Java_sp before copying the rest of the new data
|
||||
//
|
||||
// Hack Alert: Temporary bugfix for 4717480/4721647
|
||||
// To act like previous version (pd_cache_state) don't null _last_Java_sp
|
||||
// unless the value is changing
|
||||
//
|
||||
assert(src != nullptr, "Src should not be null.");
|
||||
if (_last_Java_sp != src->_last_Java_sp) {
|
||||
_last_Java_sp = nullptr;
|
||||
OrderAccess::release();
|
||||
}
|
||||
_last_Java_fp = src->_last_Java_fp;
|
||||
_last_Java_pc = src->_last_Java_pc;
|
||||
|
||||
@@ -225,36 +225,6 @@ void MacroAssembler::pop_cont_fastpath(Register java_thread) {
|
||||
bind(done);
|
||||
}
|
||||
|
||||
void MacroAssembler::inc_held_monitor_count(Register tmp) {
|
||||
Address dst(xthread, JavaThread::held_monitor_count_offset());
|
||||
ld(tmp, dst);
|
||||
addi(tmp, tmp, 1);
|
||||
sd(tmp, dst);
|
||||
#ifdef ASSERT
|
||||
Label ok;
|
||||
test_bit(tmp, tmp, 63);
|
||||
beqz(tmp, ok);
|
||||
STOP("assert(held monitor count overflow)");
|
||||
should_not_reach_here();
|
||||
bind(ok);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MacroAssembler::dec_held_monitor_count(Register tmp) {
|
||||
Address dst(xthread, JavaThread::held_monitor_count_offset());
|
||||
ld(tmp, dst);
|
||||
subi(tmp, tmp, 1);
|
||||
sd(tmp, dst);
|
||||
#ifdef ASSERT
|
||||
Label ok;
|
||||
test_bit(tmp, tmp, 63);
|
||||
beqz(tmp, ok);
|
||||
STOP("assert(held monitor count underflow)");
|
||||
should_not_reach_here();
|
||||
bind(ok);
|
||||
#endif
|
||||
}
|
||||
|
||||
int MacroAssembler::align(int modulus, int extra_offset) {
|
||||
CompressibleScope scope(this);
|
||||
intptr_t before = offset();
|
||||
@@ -355,14 +325,15 @@ void MacroAssembler::call_VM(Register oop_result,
|
||||
}
|
||||
|
||||
void MacroAssembler::post_call_nop() {
|
||||
assert(!in_compressible_scope(), "Must be");
|
||||
assert_alignment(pc());
|
||||
if (!Continuations::enabled()) {
|
||||
return;
|
||||
}
|
||||
relocate(post_call_nop_Relocation::spec(), [&] {
|
||||
InlineSkippedInstructionsCounter skipCounter(this);
|
||||
nop();
|
||||
li32(zr, 0);
|
||||
});
|
||||
relocate(post_call_nop_Relocation::spec());
|
||||
InlineSkippedInstructionsCounter skipCounter(this);
|
||||
nop();
|
||||
li32(zr, 0);
|
||||
}
|
||||
|
||||
// these are no-ops overridden by InterpreterMacroAssembler
|
||||
@@ -389,12 +360,14 @@ void MacroAssembler::set_last_Java_frame(Register last_java_sp,
|
||||
last_java_sp = esp;
|
||||
}
|
||||
|
||||
sd(last_java_sp, Address(xthread, JavaThread::last_Java_sp_offset()));
|
||||
|
||||
// last_java_fp is optional
|
||||
if (last_java_fp->is_valid()) {
|
||||
sd(last_java_fp, Address(xthread, JavaThread::last_Java_fp_offset()));
|
||||
}
|
||||
|
||||
// We must set sp last.
|
||||
sd(last_java_sp, Address(xthread, JavaThread::last_Java_sp_offset()));
|
||||
|
||||
}
|
||||
|
||||
void MacroAssembler::set_last_Java_frame(Register last_java_sp,
|
||||
@@ -5013,7 +4986,7 @@ address MacroAssembler::reloc_call(Address entry, Register tmp) {
|
||||
|
||||
address MacroAssembler::ic_call(address entry, jint method_index) {
|
||||
RelocationHolder rh = virtual_call_Relocation::spec(pc(), method_index);
|
||||
IncompressibleScope scope(this); // relocations
|
||||
assert(!in_compressible_scope(), "Must be");
|
||||
movptr(t0, (address)Universe::non_oop_word(), t1);
|
||||
assert_cond(entry != nullptr);
|
||||
return reloc_call(Address(entry, rh));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2024, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@@ -849,9 +849,6 @@ public:
|
||||
void push_cont_fastpath(Register java_thread = xthread);
|
||||
void pop_cont_fastpath(Register java_thread = xthread);
|
||||
|
||||
void inc_held_monitor_count(Register tmp);
|
||||
void dec_held_monitor_count(Register tmp);
|
||||
|
||||
// if heap base register is used - reinit it with the correct value
|
||||
void reinit_heapbase();
|
||||
|
||||
|
||||
@@ -331,13 +331,10 @@ bool NativeInstruction::is_safepoint_poll() {
|
||||
return MacroAssembler::is_lwu_to_zr(address(this));
|
||||
}
|
||||
|
||||
void NativeIllegalInstruction::insert(address code_pos) {
|
||||
assert_cond(code_pos != nullptr);
|
||||
Assembler::sd_instr(code_pos, 0xffffffff); // all bits ones is permanently reserved as an illegal instruction
|
||||
}
|
||||
|
||||
bool NativeInstruction::is_stop() {
|
||||
return uint_at(0) == 0xc0101073; // an illegal instruction, 'csrrw x0, time, x0'
|
||||
// an illegal instruction, 'csrrw x0, time, x0'
|
||||
uint32_t encoded = Assembler::encode_csrrw(x0, Assembler::time, x0);
|
||||
return uint_at(0) == encoded;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -347,6 +344,8 @@ void NativeGeneralJump::insert_unconditional(address code_pos, address entry) {
|
||||
MacroAssembler a(&cb);
|
||||
Assembler::IncompressibleScope scope(&a); // Fixed length: see NativeGeneralJump::get_instruction_size()
|
||||
|
||||
MacroAssembler::assert_alignment(code_pos);
|
||||
|
||||
int32_t offset = 0;
|
||||
a.movptr(t1, entry, offset, t0); // lui, lui, slli, add
|
||||
a.jr(t1, offset); // jalr
|
||||
@@ -378,6 +377,7 @@ bool NativePostCallNop::decode(int32_t& oopmap_slot, int32_t& cb_offset) const {
|
||||
}
|
||||
|
||||
bool NativePostCallNop::patch(int32_t oopmap_slot, int32_t cb_offset) {
|
||||
MacroAssembler::assert_alignment(addr_at(4));
|
||||
if (((oopmap_slot & 0xff) != oopmap_slot) || ((cb_offset & 0xffffff) != cb_offset)) {
|
||||
return false; // cannot encode
|
||||
}
|
||||
@@ -389,14 +389,17 @@ bool NativePostCallNop::patch(int32_t oopmap_slot, int32_t cb_offset) {
|
||||
return true; // successfully encoded
|
||||
}
|
||||
|
||||
void NativeDeoptInstruction::verify() {
|
||||
bool NativeDeoptInstruction::is_deopt_at(address instr) {
|
||||
assert(instr != nullptr, "Must be");
|
||||
uint32_t value = Assembler::ld_instr(instr);
|
||||
uint32_t encoded = Assembler::encode_csrrw(x0, Assembler::instret, x0);
|
||||
return value == encoded;
|
||||
}
|
||||
|
||||
// Inserts an undefined instruction at a given pc
|
||||
void NativeDeoptInstruction::insert(address code_pos) {
|
||||
// 0xc0201073 encodes CSRRW x0, instret, x0
|
||||
uint32_t insn = 0xc0201073;
|
||||
uint32_t *pos = (uint32_t *) code_pos;
|
||||
*pos = insn;
|
||||
MacroAssembler::assert_alignment(code_pos);
|
||||
uint32_t encoded = Assembler::encode_csrrw(x0, Assembler::instret, x0);
|
||||
Assembler::sd_instr(code_pos, encoded);
|
||||
ICache::invalidate_range(code_pos, 4);
|
||||
}
|
||||
|
||||
@@ -294,12 +294,6 @@ inline NativeGeneralJump* nativeGeneralJump_at(address addr) {
|
||||
return jump;
|
||||
}
|
||||
|
||||
class NativeIllegalInstruction: public NativeInstruction {
|
||||
public:
|
||||
// Insert illegal opcode as specific address
|
||||
static void insert(address code_pos);
|
||||
};
|
||||
|
||||
inline bool NativeInstruction::is_nop() const {
|
||||
uint32_t insn = Assembler::ld_instr(addr_at(0));
|
||||
return insn == 0x13;
|
||||
@@ -353,14 +347,7 @@ class NativeDeoptInstruction: public NativeInstruction {
|
||||
address instruction_address() const { return addr_at(instruction_offset); }
|
||||
address next_instruction_address() const { return addr_at(instruction_size); }
|
||||
|
||||
void verify();
|
||||
|
||||
static bool is_deopt_at(address instr) {
|
||||
assert(instr != nullptr, "");
|
||||
uint32_t value = Assembler::ld_instr(instr);
|
||||
// 0xc0201073 encodes CSRRW x0, instret, x0
|
||||
return value == 0xc0201073;
|
||||
}
|
||||
static bool is_deopt_at(address instr);
|
||||
|
||||
// MT-safe patching
|
||||
static void insert(address code_pos);
|
||||
|
||||
@@ -1269,6 +1269,26 @@ int CallDynamicJavaDirectNode::compute_padding(int current_offset) const
|
||||
return align_up(current_offset, alignment_required()) - current_offset;
|
||||
}
|
||||
|
||||
int CallRuntimeDirectNode::compute_padding(int current_offset) const
|
||||
{
|
||||
return align_up(current_offset, alignment_required()) - current_offset;
|
||||
}
|
||||
|
||||
int CallLeafDirectNode::compute_padding(int current_offset) const
|
||||
{
|
||||
return align_up(current_offset, alignment_required()) - current_offset;
|
||||
}
|
||||
|
||||
int CallLeafDirectVectorNode::compute_padding(int current_offset) const
|
||||
{
|
||||
return align_up(current_offset, alignment_required()) - current_offset;
|
||||
}
|
||||
|
||||
int CallLeafNoFPDirectNode::compute_padding(int current_offset) const
|
||||
{
|
||||
return align_up(current_offset, alignment_required()) - current_offset;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
#ifndef PRODUCT
|
||||
@@ -2132,10 +2152,6 @@ RegMask Matcher::modL_proj_mask() {
|
||||
return RegMask();
|
||||
}
|
||||
|
||||
const RegMask Matcher::method_handle_invoke_SP_save_mask() {
|
||||
return FP_REG_mask();
|
||||
}
|
||||
|
||||
bool size_fits_all_mem_uses(AddPNode* addp, int shift) {
|
||||
assert_cond(addp != nullptr);
|
||||
for (DUIterator_Fast imax, i = addp->fast_outs(imax); i < imax; i++) {
|
||||
@@ -8175,7 +8191,7 @@ instruct unnecessary_membar_volatile_rvtso() %{
|
||||
ins_cost(0);
|
||||
|
||||
size(0);
|
||||
|
||||
|
||||
format %{ "#@unnecessary_membar_volatile_rvtso (unnecessary so empty encoding)" %}
|
||||
ins_encode %{
|
||||
__ block_comment("unnecessary_membar_volatile_rvtso");
|
||||
@@ -10509,6 +10525,7 @@ instruct CallRuntimeDirect(method meth)
|
||||
ins_encode(riscv_enc_java_to_runtime(meth));
|
||||
|
||||
ins_pipe(pipe_class_call);
|
||||
ins_alignment(4);
|
||||
%}
|
||||
|
||||
// Call Runtime Instruction
|
||||
@@ -10526,6 +10543,7 @@ instruct CallLeafDirect(method meth)
|
||||
ins_encode(riscv_enc_java_to_runtime(meth));
|
||||
|
||||
ins_pipe(pipe_class_call);
|
||||
ins_alignment(4);
|
||||
%}
|
||||
|
||||
// Call Runtime Instruction without safepoint and with vector arguments
|
||||
@@ -10543,6 +10561,7 @@ instruct CallLeafDirectVector(method meth)
|
||||
ins_encode(riscv_enc_java_to_runtime(meth));
|
||||
|
||||
ins_pipe(pipe_class_call);
|
||||
ins_alignment(4);
|
||||
%}
|
||||
|
||||
// Call Runtime Instruction
|
||||
@@ -10560,6 +10579,7 @@ instruct CallLeafNoFPDirect(method meth)
|
||||
ins_encode(riscv_enc_java_to_runtime(meth));
|
||||
|
||||
ins_pipe(pipe_class_call);
|
||||
ins_alignment(4);
|
||||
%}
|
||||
|
||||
// ============================================================================
|
||||
@@ -10971,6 +10991,7 @@ instruct arrays_hashcode(iRegP_R11 ary, iRegI_R12 cnt, iRegI_R10 result, immI ba
|
||||
iRegLNoSp tmp3, iRegLNoSp tmp4,
|
||||
iRegLNoSp tmp5, iRegLNoSp tmp6, rFlagsReg cr)
|
||||
%{
|
||||
predicate(!UseRVV);
|
||||
match(Set result (VectorizedHashCode (Binary ary cnt) (Binary result basic_type)));
|
||||
effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, TEMP tmp6,
|
||||
USE_KILL ary, USE_KILL cnt, USE basic_type, KILL cr);
|
||||
|
||||
@@ -4080,6 +4080,28 @@ instruct varray_equalsC(iRegP_R11 ary1, iRegP_R12 ary2, iRegI_R10 result,
|
||||
ins_pipe(pipe_class_memory);
|
||||
%}
|
||||
|
||||
// fast ArraysSupport.vectorizedHashCode
|
||||
instruct varrays_hashcode(iRegP_R11 ary, iRegI_R12 cnt, iRegI_R10 result, immI basic_type,
|
||||
vReg_V2 v2, vReg_V3 v3, vReg_V4 v4, vReg_V5 v5,
|
||||
vReg_V6 v6, vReg_V7 v7, vReg_V8 v8, vReg_V9 v9,
|
||||
iRegLNoSp tmp1, iRegLNoSp tmp2, iRegLNoSp tmp3,
|
||||
rFlagsReg cr)
|
||||
%{
|
||||
predicate(UseRVV);
|
||||
match(Set result (VectorizedHashCode (Binary ary cnt) (Binary result basic_type)));
|
||||
effect(USE_KILL ary, USE_KILL cnt, USE basic_type,
|
||||
TEMP v2, TEMP v3, TEMP v4, TEMP v5, TEMP v6, TEMP v7, TEMP v8, TEMP v9,
|
||||
TEMP tmp1, TEMP tmp2, TEMP tmp3, KILL cr);
|
||||
|
||||
format %{ "Array HashCode array[] $ary,$cnt,$result,$basic_type -> $result // KILL all" %}
|
||||
ins_encode %{
|
||||
__ arrays_hashcode_v($ary$$Register, $cnt$$Register, $result$$Register,
|
||||
$tmp1$$Register, $tmp2$$Register, $tmp3$$Register,
|
||||
(BasicType)$basic_type$$constant);
|
||||
%}
|
||||
ins_pipe(pipe_class_memory);
|
||||
%}
|
||||
|
||||
instruct vstring_compareU_128b(iRegP_R11 str1, iRegI_R12 cnt1, iRegP_R13 str2, iRegI_R14 cnt2,
|
||||
iRegI_R10 result, vReg_V4 v4, vReg_V5 v5, vReg_V6 v6, vReg_V7 v7,
|
||||
vReg_V8 v8, vReg_V9 v9, vReg_V10 v10, vReg_V11 v11,
|
||||
|
||||
@@ -885,11 +885,8 @@ static void fill_continuation_entry(MacroAssembler* masm) {
|
||||
|
||||
__ ld(t0, Address(xthread, JavaThread::cont_fastpath_offset()));
|
||||
__ sd(t0, Address(sp, ContinuationEntry::parent_cont_fastpath_offset()));
|
||||
__ ld(t0, Address(xthread, JavaThread::held_monitor_count_offset()));
|
||||
__ sd(t0, Address(sp, ContinuationEntry::parent_held_monitor_count_offset()));
|
||||
|
||||
__ sd(zr, Address(xthread, JavaThread::cont_fastpath_offset()));
|
||||
__ sd(zr, Address(xthread, JavaThread::held_monitor_count_offset()));
|
||||
}
|
||||
|
||||
// on entry, sp points to the ContinuationEntry
|
||||
@@ -905,50 +902,6 @@ static void continuation_enter_cleanup(MacroAssembler* masm) {
|
||||
|
||||
__ ld(t0, Address(sp, ContinuationEntry::parent_cont_fastpath_offset()));
|
||||
__ sd(t0, Address(xthread, JavaThread::cont_fastpath_offset()));
|
||||
|
||||
if (CheckJNICalls) {
|
||||
// Check if this is a virtual thread continuation
|
||||
Label L_skip_vthread_code;
|
||||
__ lwu(t0, Address(sp, ContinuationEntry::flags_offset()));
|
||||
__ beqz(t0, L_skip_vthread_code);
|
||||
|
||||
// If the held monitor count is > 0 and this vthread is terminating then
|
||||
// it failed to release a JNI monitor. So we issue the same log message
|
||||
// that JavaThread::exit does.
|
||||
__ ld(t0, Address(xthread, JavaThread::jni_monitor_count_offset()));
|
||||
__ beqz(t0, L_skip_vthread_code);
|
||||
|
||||
// Save return value potentially containing the exception oop in callee-saved x9
|
||||
__ mv(x9, x10);
|
||||
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::log_jni_monitor_still_held));
|
||||
// Restore potential return value
|
||||
__ mv(x10, x9);
|
||||
|
||||
// For vthreads we have to explicitly zero the JNI monitor count of the carrier
|
||||
// on termination. The held count is implicitly zeroed below when we restore from
|
||||
// the parent held count (which has to be zero).
|
||||
__ sd(zr, Address(xthread, JavaThread::jni_monitor_count_offset()));
|
||||
|
||||
__ bind(L_skip_vthread_code);
|
||||
}
|
||||
#ifdef ASSERT
|
||||
else {
|
||||
// Check if this is a virtual thread continuation
|
||||
Label L_skip_vthread_code;
|
||||
__ lwu(t0, Address(sp, ContinuationEntry::flags_offset()));
|
||||
__ beqz(t0, L_skip_vthread_code);
|
||||
|
||||
// See comment just above. If not checking JNI calls the JNI count is only
|
||||
// needed for assertion checking.
|
||||
__ sd(zr, Address(xthread, JavaThread::jni_monitor_count_offset()));
|
||||
|
||||
__ bind(L_skip_vthread_code);
|
||||
}
|
||||
#endif
|
||||
|
||||
__ ld(t0, Address(sp, ContinuationEntry::parent_held_monitor_count_offset()));
|
||||
__ sd(t0, Address(xthread, JavaThread::held_monitor_count_offset()));
|
||||
|
||||
__ ld(t0, Address(sp, ContinuationEntry::parent_offset()));
|
||||
__ sd(t0, Address(xthread, JavaThread::cont_entry_offset()));
|
||||
__ add(fp, sp, (int)ContinuationEntry::size() + 2 * wordSize /* 2 extra words to match up with leave() */);
|
||||
@@ -1002,20 +955,23 @@ static void gen_continuation_enter(MacroAssembler* masm,
|
||||
|
||||
__ bnez(c_rarg2, call_thaw);
|
||||
|
||||
// Make sure the call is patchable
|
||||
__ align(NativeInstruction::instruction_size);
|
||||
address call_pc;
|
||||
{
|
||||
Assembler::IncompressibleScope scope(masm);
|
||||
// Make sure the call is patchable
|
||||
__ align(NativeInstruction::instruction_size);
|
||||
|
||||
const address tr_call = __ reloc_call(resolve);
|
||||
if (tr_call == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
call_pc = __ reloc_call(resolve);
|
||||
if (call_pc == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
}
|
||||
|
||||
oop_maps->add_gc_map(__ pc() - start, map);
|
||||
__ post_call_nop();
|
||||
}
|
||||
|
||||
oop_maps->add_gc_map(__ pc() - start, map);
|
||||
__ post_call_nop();
|
||||
|
||||
__ j(exit);
|
||||
|
||||
address stub = CompiledDirectCall::emit_to_interp_stub(masm, tr_call);
|
||||
address stub = CompiledDirectCall::emit_to_interp_stub(masm, call_pc);
|
||||
if (stub == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
}
|
||||
@@ -1034,26 +990,36 @@ static void gen_continuation_enter(MacroAssembler* masm,
|
||||
|
||||
__ bnez(c_rarg2, call_thaw);
|
||||
|
||||
// Make sure the call is patchable
|
||||
__ align(NativeInstruction::instruction_size);
|
||||
address call_pc;
|
||||
{
|
||||
Assembler::IncompressibleScope scope(masm);
|
||||
// Make sure the call is patchable
|
||||
__ align(NativeInstruction::instruction_size);
|
||||
|
||||
const address tr_call = __ reloc_call(resolve);
|
||||
if (tr_call == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
call_pc = __ reloc_call(resolve);
|
||||
if (call_pc == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
}
|
||||
|
||||
oop_maps->add_gc_map(__ pc() - start, map);
|
||||
__ post_call_nop();
|
||||
}
|
||||
|
||||
oop_maps->add_gc_map(__ pc() - start, map);
|
||||
__ post_call_nop();
|
||||
|
||||
__ j(exit);
|
||||
|
||||
__ bind(call_thaw);
|
||||
|
||||
ContinuationEntry::_thaw_call_pc_offset = __ pc() - start;
|
||||
__ rt_call(CAST_FROM_FN_PTR(address, StubRoutines::cont_thaw()));
|
||||
oop_maps->add_gc_map(__ pc() - start, map->deep_copy());
|
||||
ContinuationEntry::_return_pc_offset = __ pc() - start;
|
||||
__ post_call_nop();
|
||||
// Post call nops must be natural aligned due to cmodx rules.
|
||||
{
|
||||
Assembler::IncompressibleScope scope(masm);
|
||||
__ align(NativeInstruction::instruction_size);
|
||||
|
||||
ContinuationEntry::_thaw_call_pc_offset = __ pc() - start;
|
||||
__ rt_call(CAST_FROM_FN_PTR(address, StubRoutines::cont_thaw()));
|
||||
oop_maps->add_gc_map(__ pc() - start, map->deep_copy());
|
||||
ContinuationEntry::_return_pc_offset = __ pc() - start;
|
||||
__ post_call_nop();
|
||||
}
|
||||
|
||||
__ bind(exit);
|
||||
ContinuationEntry::_cleanup_offset = __ pc() - start;
|
||||
@@ -1082,7 +1048,7 @@ static void gen_continuation_enter(MacroAssembler* masm,
|
||||
__ jr(x11); // the exception handler
|
||||
}
|
||||
|
||||
address stub = CompiledDirectCall::emit_to_interp_stub(masm, tr_call);
|
||||
address stub = CompiledDirectCall::emit_to_interp_stub(masm, call_pc);
|
||||
if (stub == nullptr) {
|
||||
fatal("CodeCache is full at gen_continuation_enter");
|
||||
}
|
||||
@@ -1115,10 +1081,16 @@ static void gen_continuation_yield(MacroAssembler* masm,
|
||||
|
||||
__ mv(c_rarg1, sp);
|
||||
|
||||
// Post call nops must be natural aligned due to cmodx rules.
|
||||
__ align(NativeInstruction::instruction_size);
|
||||
|
||||
frame_complete = __ pc() - start;
|
||||
address the_pc = __ pc();
|
||||
|
||||
__ post_call_nop(); // this must be exactly after the pc value that is pushed into the frame info, we use this nop for fast CodeBlob lookup
|
||||
{
|
||||
Assembler::IncompressibleScope scope(masm);
|
||||
__ post_call_nop(); // this must be exactly after the pc value that is pushed into the frame info, we use this nop for fast CodeBlob lookup
|
||||
}
|
||||
|
||||
__ mv(c_rarg0, xthread);
|
||||
__ set_last_Java_frame(sp, fp, the_pc, t0);
|
||||
|
||||
@@ -73,6 +73,9 @@
|
||||
do_stub(compiler, string_indexof_linear_ul) \
|
||||
do_arch_entry(riscv, compiler, string_indexof_linear_ul, \
|
||||
string_indexof_linear_ul, string_indexof_linear_ul) \
|
||||
do_stub(compiler, arrays_hashcode_powers_of_31) \
|
||||
do_arch_entry(riscv, compiler, arrays_hashcode_powers_of_31, \
|
||||
arrays_hashcode_powers_of_31, arrays_hashcode_powers_of_31) \
|
||||
|
||||
|
||||
#define STUBGEN_FINAL_BLOBS_ARCH_DO(do_stub, \
|
||||
|
||||
@@ -6624,6 +6624,24 @@ static const int64_t right_3_bits = right_n_bits(3);
|
||||
return start;
|
||||
}
|
||||
|
||||
address generate_arrays_hashcode_powers_of_31() {
|
||||
assert(UseRVV, "sanity");
|
||||
const int lmul = 2;
|
||||
const int stride = MaxVectorSize / sizeof(jint) * lmul;
|
||||
__ align(CodeEntryAlignment);
|
||||
StubCodeMark mark(this, "StubRoutines", "arrays_hashcode_powers_of_31");
|
||||
address start = __ pc();
|
||||
for (int i = stride; i >= 0; i--) {
|
||||
jint power_of_31 = 1;
|
||||
for (int j = i; j > 0; j--) {
|
||||
power_of_31 = java_multiply(power_of_31, 31);
|
||||
}
|
||||
__ emit_int32(power_of_31);
|
||||
}
|
||||
|
||||
return start;
|
||||
}
|
||||
|
||||
#endif // COMPILER2
|
||||
|
||||
/**
|
||||
@@ -6818,6 +6836,10 @@ static const int64_t right_3_bits = right_n_bits(3);
|
||||
StubRoutines::_bigIntegerRightShiftWorker = generate_bigIntegerRightShift();
|
||||
}
|
||||
|
||||
if (UseVectorizedHashCodeIntrinsic && UseRVV) {
|
||||
StubRoutines::riscv::_arrays_hashcode_powers_of_31 = generate_arrays_hashcode_powers_of_31();
|
||||
}
|
||||
|
||||
if (UseSHA256Intrinsics) {
|
||||
Sha2Generator sha2(_masm, this);
|
||||
StubRoutines::_sha256_implCompress = sha2.generate_sha256_implCompress(StubId::stubgen_sha256_implCompress_id);
|
||||
|
||||
@@ -35,20 +35,20 @@
|
||||
|
||||
uint32_t VM_Version::_initial_vector_length = 0;
|
||||
|
||||
#define DEF_RV_EXT_FEATURE(NAME, PRETTY, LINUX_BIT, FSTRING, FLAGF) \
|
||||
VM_Version::NAME##RVExtFeatureValue VM_Version::NAME;
|
||||
#define DEF_RV_EXT_FEATURE(PRETTY, LINUX_BIT, FSTRING, FLAGF) \
|
||||
VM_Version::ext_##PRETTY##RVExtFeatureValue VM_Version::ext_##PRETTY;
|
||||
RV_EXT_FEATURE_FLAGS(DEF_RV_EXT_FEATURE)
|
||||
#undef DEF_RV_EXT_FEATURE
|
||||
|
||||
#define DEF_RV_NON_EXT_FEATURE(NAME, PRETTY, LINUX_BIT, FSTRING, FLAGF) \
|
||||
VM_Version::NAME##RVNonExtFeatureValue VM_Version::NAME;
|
||||
#define DEF_RV_NON_EXT_FEATURE(PRETTY, LINUX_BIT, FSTRING, FLAGF) \
|
||||
VM_Version::PRETTY##RVNonExtFeatureValue VM_Version::PRETTY;
|
||||
RV_NON_EXT_FEATURE_FLAGS(DEF_RV_NON_EXT_FEATURE)
|
||||
#undef DEF_RV_NON_EXT_FEATURE
|
||||
|
||||
#define ADD_RV_EXT_FEATURE_IN_LIST(NAME, PRETTY, LINUX_BIT, FSTRING, FLAGF) \
|
||||
&VM_Version::NAME,
|
||||
#define ADD_RV_NON_EXT_FEATURE_IN_LIST(NAME, PRETTY, LINUX_BIT, FSTRING, FLAGF) \
|
||||
&VM_Version::NAME,
|
||||
#define ADD_RV_EXT_FEATURE_IN_LIST(PRETTY, LINUX_BIT, FSTRING, FLAGF) \
|
||||
&VM_Version::ext_##PRETTY,
|
||||
#define ADD_RV_NON_EXT_FEATURE_IN_LIST(PRETTY, LINUX_BIT, FSTRING, FLAGF) \
|
||||
&VM_Version::PRETTY,
|
||||
VM_Version::RVFeatureValue* VM_Version::_feature_list[] = {
|
||||
RV_EXT_FEATURE_FLAGS(ADD_RV_EXT_FEATURE_IN_LIST)
|
||||
RV_NON_EXT_FEATURE_FLAGS(ADD_RV_NON_EXT_FEATURE_IN_LIST)
|
||||
@@ -148,7 +148,7 @@ void VM_Version::common_initialize() {
|
||||
FLAG_SET_DEFAULT(UseSignumIntrinsic, true);
|
||||
}
|
||||
|
||||
if (UseRVC && !ext_C.enabled()) {
|
||||
if (UseRVC && !ext_c.enabled()) {
|
||||
warning("RVC is not supported on this CPU");
|
||||
FLAG_SET_DEFAULT(UseRVC, false);
|
||||
|
||||
@@ -160,7 +160,7 @@ void VM_Version::common_initialize() {
|
||||
|
||||
if (FLAG_IS_DEFAULT(AvoidUnalignedAccesses)) {
|
||||
FLAG_SET_DEFAULT(AvoidUnalignedAccesses,
|
||||
unaligned_access.value() != MISALIGNED_FAST);
|
||||
unaligned_scalar.value() != MISALIGNED_SCALAR_FAST);
|
||||
}
|
||||
|
||||
if (!AvoidUnalignedAccesses) {
|
||||
@@ -175,7 +175,12 @@ void VM_Version::common_initialize() {
|
||||
// This machine has fast unaligned memory accesses
|
||||
if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
|
||||
FLAG_SET_DEFAULT(UseUnalignedAccesses,
|
||||
unaligned_access.value() == MISALIGNED_FAST);
|
||||
(unaligned_scalar.value() == MISALIGNED_SCALAR_FAST));
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(AlignVector)) {
|
||||
FLAG_SET_DEFAULT(AlignVector,
|
||||
unaligned_vector.value() != MISALIGNED_VECTOR_FAST);
|
||||
}
|
||||
|
||||
#ifdef __riscv_ztso
|
||||
@@ -208,13 +213,8 @@ void VM_Version::common_initialize() {
|
||||
}
|
||||
|
||||
if (UseRVV) {
|
||||
if (!ext_V.enabled() && FLAG_IS_DEFAULT(UseRVV)) {
|
||||
warning("RVV is not supported on this CPU");
|
||||
FLAG_SET_DEFAULT(UseRVV, false);
|
||||
} else {
|
||||
// read vector length from vector CSR vlenb
|
||||
_initial_vector_length = cpu_vector_length();
|
||||
}
|
||||
// read vector length from vector CSR vlenb
|
||||
_initial_vector_length = cpu_vector_length();
|
||||
}
|
||||
|
||||
// Misc Intrinsics that could depend on RVV.
|
||||
@@ -234,36 +234,6 @@ void VM_Version::common_initialize() {
|
||||
warning("CRC32C intrinsics are not available on this CPU.");
|
||||
FLAG_SET_DEFAULT(UseCRC32CIntrinsics, false);
|
||||
}
|
||||
|
||||
// UseZvbb (depends on RVV).
|
||||
if (UseZvbb && !UseRVV) {
|
||||
warning("Cannot enable UseZvbb on cpu without RVV support.");
|
||||
FLAG_SET_DEFAULT(UseZvbb, false);
|
||||
}
|
||||
|
||||
// UseZvbc (depends on RVV).
|
||||
if (UseZvbc && !UseRVV) {
|
||||
warning("Cannot enable UseZvbc on cpu without RVV support.");
|
||||
FLAG_SET_DEFAULT(UseZvbc, false);
|
||||
}
|
||||
|
||||
// UseZvkn (depends on RVV).
|
||||
if (UseZvkn && !UseRVV) {
|
||||
warning("Cannot enable UseZvkn on cpu without RVV support.");
|
||||
FLAG_SET_DEFAULT(UseZvkn, false);
|
||||
}
|
||||
|
||||
// UseZvfh (depends on RVV)
|
||||
if (UseZvfh) {
|
||||
if (!UseRVV) {
|
||||
warning("Cannot enable UseZvfh on cpu without RVV support.");
|
||||
FLAG_SET_DEFAULT(UseZvfh, false);
|
||||
}
|
||||
if (!UseZfh) {
|
||||
warning("Cannot enable UseZvfh on cpu without Zfh support.");
|
||||
FLAG_SET_DEFAULT(UseZvfh, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef COMPILER2
|
||||
|
||||
@@ -70,6 +70,35 @@ class VM_Version : public Abstract_VM_Version {
|
||||
int64_t value() { return _value; }
|
||||
virtual bool enabled() = 0;
|
||||
virtual void update_flag() = 0;
|
||||
|
||||
protected:
|
||||
bool deps_all_enabled(RVFeatureValue* dep0, ...) {
|
||||
assert(dep0 != nullptr, "must not");
|
||||
|
||||
va_list va;
|
||||
va_start(va, dep0);
|
||||
RVFeatureValue* next = dep0;
|
||||
bool enabled = true;
|
||||
while (next != nullptr && enabled) {
|
||||
enabled = next->enabled();
|
||||
next = va_arg(va, RVFeatureValue*);
|
||||
}
|
||||
va_end(va);
|
||||
return enabled;
|
||||
}
|
||||
|
||||
void deps_string(stringStream& ss, RVFeatureValue* dep0, ...) {
|
||||
assert(dep0 != nullptr, "must not");
|
||||
ss.print("%s (%s)", dep0->pretty(), dep0->enabled() ? "enabled" : "disabled");
|
||||
|
||||
va_list va;
|
||||
va_start(va, dep0);
|
||||
RVFeatureValue* next = nullptr;
|
||||
while ((next = va_arg(va, RVFeatureValue*)) != nullptr) {
|
||||
ss.print(", %s (%s)", next->pretty(), next->enabled() ? "enabled" : "disabled");
|
||||
}
|
||||
va_end(va);
|
||||
}
|
||||
};
|
||||
|
||||
#define UPDATE_DEFAULT(flag) \
|
||||
@@ -85,27 +114,34 @@ class VM_Version : public Abstract_VM_Version {
|
||||
} \
|
||||
} \
|
||||
|
||||
#define UPDATE_DEFAULT_DEP(flag, dep) \
|
||||
void update_flag() { \
|
||||
assert(enabled(), "Must be."); \
|
||||
/* dep must be declared before */ \
|
||||
assert((uintptr_t)(this) > \
|
||||
(uintptr_t)(&dep), "Invalid"); \
|
||||
if (FLAG_IS_DEFAULT(flag)) { \
|
||||
if (dep.enabled()) { \
|
||||
FLAG_SET_DEFAULT(flag, true); \
|
||||
} else { \
|
||||
FLAG_SET_DEFAULT(flag, false); \
|
||||
/* Sync CPU features with flags */ \
|
||||
disable_feature(); \
|
||||
} \
|
||||
} else { \
|
||||
/* Sync CPU features with flags */ \
|
||||
if (!flag) { \
|
||||
disable_feature(); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
#define UPDATE_DEFAULT_DEP(flag, dep0, ...) \
|
||||
void update_flag() { \
|
||||
assert(enabled(), "Must be."); \
|
||||
if (FLAG_IS_DEFAULT(flag)) { \
|
||||
if (this->deps_all_enabled(dep0, ##__VA_ARGS__)) { \
|
||||
FLAG_SET_DEFAULT(flag, true); \
|
||||
} else { \
|
||||
FLAG_SET_DEFAULT(flag, false); \
|
||||
stringStream ss; \
|
||||
deps_string(ss, dep0, ##__VA_ARGS__); \
|
||||
warning("Cannot enable " #flag ", it's missing dependent extension(s) %s", ss.as_string(true)); \
|
||||
/* Sync CPU features with flags */ \
|
||||
disable_feature(); \
|
||||
} \
|
||||
} else { \
|
||||
/* Sync CPU features with flags */ \
|
||||
if (!flag) { \
|
||||
disable_feature(); \
|
||||
} else if (!deps_all_enabled(dep0, ##__VA_ARGS__)) { \
|
||||
FLAG_SET_DEFAULT(flag, false); \
|
||||
stringStream ss; \
|
||||
deps_string(ss, dep0, ##__VA_ARGS__); \
|
||||
warning("Cannot enable " #flag ", it's missing dependent extension(s) %s", ss.as_string(true)); \
|
||||
/* Sync CPU features with flags */ \
|
||||
disable_feature(); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
|
||||
#define NO_UPDATE_DEFAULT \
|
||||
void update_flag() {} \
|
||||
@@ -149,51 +185,6 @@ class VM_Version : public Abstract_VM_Version {
|
||||
}
|
||||
};
|
||||
|
||||
// Frozen standard extensions
|
||||
// I RV64I
|
||||
// M Integer Multiplication and Division
|
||||
// A Atomic Instructions
|
||||
// F Single-Precision Floating-Point
|
||||
// D Single-Precision Floating-Point
|
||||
// (G = M + A + F + D)
|
||||
// Q Quad-Precision Floating-Point
|
||||
// C Compressed Instructions
|
||||
// H Hypervisor
|
||||
//
|
||||
// Others, open and non-standard
|
||||
// V Vector
|
||||
//
|
||||
// Cache Management Operations
|
||||
// Zicbom Cache Block Management Operations
|
||||
// Zicboz Cache Block Zero Operations
|
||||
// Zicbop Cache Block Prefetch Operations
|
||||
//
|
||||
// Bit-manipulation
|
||||
// Zba Address generation instructions
|
||||
// Zbb Basic bit-manipulation
|
||||
// Zbc Carry-less multiplication
|
||||
// Zbs Single-bit instructions
|
||||
//
|
||||
// Zfh Half-Precision Floating-Point instructions
|
||||
// Zfhmin Minimal Half-Precision Floating-Point instructions
|
||||
//
|
||||
// Zicond Conditional operations
|
||||
//
|
||||
// Zicsr Control and Status Register (CSR) Instructions
|
||||
// Zifencei Instruction-Fetch Fence
|
||||
// Zic64b Cache blocks must be 64 bytes in size, naturally aligned in the address space.
|
||||
// Zihintpause Pause instruction HINT
|
||||
//
|
||||
// Zc Code Size Reduction - Additional compressed instructions.
|
||||
// Zcb Simple code-size saving instructions
|
||||
//
|
||||
// Other features and settings
|
||||
// mvendorid Manufactory JEDEC id encoded, ISA vol 2 3.1.2..
|
||||
// marchid Id for microarch. Mvendorid plus marchid uniquely identify the microarch.
|
||||
// mimpid A unique encoding of the version of the processor implementation.
|
||||
// unaligned_access Unaligned memory accesses (unknown, unspported, emulated, slow, firmware, fast)
|
||||
// satp mode SATP bits (number of virtual addr bits) mbare, sv39, sv48, sv57, sv64
|
||||
|
||||
public:
|
||||
|
||||
#define RV_NO_FLAG_BIT (BitsPerWord+1) // nth_bit will return 0 on values larger than BitsPerWord
|
||||
@@ -203,47 +194,83 @@ class VM_Version : public Abstract_VM_Version {
|
||||
// Fields description in `decl`:
|
||||
// declaration name, extension name, bit value from linux, feature string?, mapped flag)
|
||||
#define RV_EXT_FEATURE_FLAGS(decl) \
|
||||
decl(ext_I , i , ('I' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_M , m , ('M' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_A , a , ('A' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_F , f , ('F' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_D , d , ('D' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_C , c , ('C' - 'A'), true , UPDATE_DEFAULT(UseRVC)) \
|
||||
decl(ext_Q , q , ('Q' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_H , h , ('H' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_V , v , ('V' - 'A'), true , UPDATE_DEFAULT(UseRVV)) \
|
||||
decl(ext_Zicbom , Zicbom , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicbom)) \
|
||||
decl(ext_Zicboz , Zicboz , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicboz)) \
|
||||
decl(ext_Zicbop , Zicbop , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicbop)) \
|
||||
decl(ext_Zba , Zba , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZba)) \
|
||||
decl(ext_Zbb , Zbb , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbb)) \
|
||||
decl(ext_Zbc , Zbc , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_Zbs , Zbs , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbs)) \
|
||||
decl(ext_Zbkb , Zbkb , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbkb)) \
|
||||
decl(ext_Zcb , Zcb , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZcb)) \
|
||||
decl(ext_Zfa , Zfa , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfa)) \
|
||||
decl(ext_Zfh , Zfh , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfh)) \
|
||||
decl(ext_Zfhmin , Zfhmin , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfhmin)) \
|
||||
decl(ext_Zicsr , Zicsr , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_Zicntr , Zicntr , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_Zifencei , Zifencei , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
decl(ext_Zic64b , Zic64b , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZic64b)) \
|
||||
decl(ext_Ztso , Ztso , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZtso)) \
|
||||
decl(ext_Zihintpause , Zihintpause , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZihintpause)) \
|
||||
decl(ext_Zacas , Zacas , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZacas)) \
|
||||
decl(ext_Zvbb , Zvbb , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvbb, ext_V)) \
|
||||
decl(ext_Zvbc , Zvbc , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvbc, ext_V)) \
|
||||
decl(ext_Zvfh , Zvfh , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvfh, ext_V)) \
|
||||
decl(ext_Zvkn , Zvkn , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvkn, ext_V)) \
|
||||
decl(ext_Zicond , Zicond , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicond)) \
|
||||
/* A Atomic Instructions */ \
|
||||
decl(a , ('A' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
/* C Compressed Instructions */ \
|
||||
decl(c , ('C' - 'A'), true , UPDATE_DEFAULT(UseRVC)) \
|
||||
/* D Single-Precision Floating-Point */ \
|
||||
decl(d , ('D' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
/* F Single-Precision Floating-Point */ \
|
||||
decl(f , ('F' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
/* H Hypervisor */ \
|
||||
decl(h , ('H' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
/* I RV64I */ \
|
||||
decl(i , ('I' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
/* M Integer Multiplication and Division */ \
|
||||
decl(m , ('M' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
/* Q Quad-Precision Floating-Point */ \
|
||||
decl(q , ('Q' - 'A'), true , NO_UPDATE_DEFAULT) \
|
||||
/* V Vector */ \
|
||||
decl(v , ('V' - 'A'), true , UPDATE_DEFAULT(UseRVV)) \
|
||||
\
|
||||
/* ----------------------- Other extensions ----------------------- */ \
|
||||
\
|
||||
/* Atomic compare-and-swap (CAS) instructions */ \
|
||||
decl(Zacas , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZacas)) \
|
||||
/* Zba Address generation instructions */ \
|
||||
decl(Zba , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZba)) \
|
||||
/* Zbb Basic bit-manipulation */ \
|
||||
decl(Zbb , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbb)) \
|
||||
/* Zbc Carry-less multiplication */ \
|
||||
decl(Zbc , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
/* Bitmanip instructions for Cryptography */ \
|
||||
decl(Zbkb , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbkb)) \
|
||||
/* Zbs Single-bit instructions */ \
|
||||
decl(Zbs , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbs)) \
|
||||
/* Zcb Simple code-size saving instructions */ \
|
||||
decl(Zcb , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZcb)) \
|
||||
/* Additional Floating-Point instructions */ \
|
||||
decl(Zfa , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfa)) \
|
||||
/* Zfh Half-Precision Floating-Point instructions */ \
|
||||
decl(Zfh , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfh)) \
|
||||
/* Zfhmin Minimal Half-Precision Floating-Point instructions */ \
|
||||
decl(Zfhmin , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfhmin)) \
|
||||
/* Zicbom Cache Block Management Operations */ \
|
||||
decl(Zicbom , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicbom)) \
|
||||
/* Zicbop Cache Block Prefetch Operations */ \
|
||||
decl(Zicbop , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicbop)) \
|
||||
/* Zicboz Cache Block Zero Operations */ \
|
||||
decl(Zicboz , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicboz)) \
|
||||
/* Base Counters and Timers */ \
|
||||
decl(Zicntr , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
/* Zicond Conditional operations */ \
|
||||
decl(Zicond , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZicond)) \
|
||||
/* Zicsr Control and Status Register (CSR) Instructions */ \
|
||||
decl(Zicsr , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
/* Zic64b Cache blocks must be 64 bytes in size, naturally aligned in the address space. */ \
|
||||
decl(Zic64b , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZic64b)) \
|
||||
/* Zifencei Instruction-Fetch Fence */ \
|
||||
decl(Zifencei , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
|
||||
/* Zihintpause Pause instruction HINT */ \
|
||||
decl(Zihintpause , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZihintpause)) \
|
||||
/* Total Store Ordering */ \
|
||||
decl(Ztso , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZtso)) \
|
||||
/* Vector Basic Bit-manipulation */ \
|
||||
decl(Zvbb , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvbb, &ext_v, nullptr)) \
|
||||
/* Vector Carryless Multiplication */ \
|
||||
decl(Zvbc , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvbc, &ext_v, nullptr)) \
|
||||
/* Vector Extension for Half-Precision Floating-Point */ \
|
||||
decl(Zvfh , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvfh, &ext_v, &ext_Zfh, nullptr)) \
|
||||
/* Shorthand for Zvkned + Zvknhb + Zvkb + Zvkt */ \
|
||||
decl(Zvkn , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT_DEP(UseZvkn, &ext_v, nullptr)) \
|
||||
|
||||
#define DECLARE_RV_EXT_FEATURE(NAME, PRETTY, LINUX_BIT, FSTRING, FLAGF) \
|
||||
struct NAME##RVExtFeatureValue : public RVExtFeatureValue { \
|
||||
NAME##RVExtFeatureValue() : \
|
||||
RVExtFeatureValue(#PRETTY, LINUX_BIT, RVExtFeatures::CPU_##NAME, FSTRING) {} \
|
||||
FLAGF; \
|
||||
}; \
|
||||
static NAME##RVExtFeatureValue NAME; \
|
||||
#define DECLARE_RV_EXT_FEATURE(PRETTY, LINUX_BIT, FSTRING, FLAGF) \
|
||||
struct ext_##PRETTY##RVExtFeatureValue : public RVExtFeatureValue { \
|
||||
ext_##PRETTY##RVExtFeatureValue() : \
|
||||
RVExtFeatureValue(#PRETTY, LINUX_BIT, RVExtFeatures::CPU_##ext_##PRETTY, FSTRING) {} \
|
||||
FLAGF; \
|
||||
}; \
|
||||
static ext_##PRETTY##RVExtFeatureValue ext_##PRETTY; \
|
||||
|
||||
RV_EXT_FEATURE_FLAGS(DECLARE_RV_EXT_FEATURE)
|
||||
#undef DECLARE_RV_EXT_FEATURE
|
||||
@@ -251,20 +278,27 @@ class VM_Version : public Abstract_VM_Version {
|
||||
// Non-extension features
|
||||
//
|
||||
#define RV_NON_EXT_FEATURE_FLAGS(decl) \
|
||||
decl(unaligned_access , Unaligned , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(mvendorid , VendorId , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(marchid , ArchId , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(mimpid , ImpId , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(satp_mode , SATP , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(zicboz_block_size, ZicbozBlockSize , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
/* Id for microarch. Mvendorid plus marchid uniquely identify the microarch. */ \
|
||||
decl(marchid , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
/* A unique encoding of the version of the processor implementation. */ \
|
||||
decl(mimpid , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
/* SATP bits (number of virtual addr bits) mbare, sv39, sv48, sv57, sv64 */ \
|
||||
decl(satp_mode , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
/* Performance of misaligned scalar accesses (unknown, emulated, slow, fast, unsupported) */ \
|
||||
decl(unaligned_scalar , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
/* Performance of misaligned vector accesses (unknown, unspported, slow, fast) */ \
|
||||
decl(unaligned_vector , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
/* Manufactory JEDEC id encoded, ISA vol 2 3.1.2.. */ \
|
||||
decl(mvendorid , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
decl(zicboz_block_size , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \
|
||||
|
||||
#define DECLARE_RV_NON_EXT_FEATURE(NAME, PRETTY, LINUX_BIT, FSTRING, FLAGF) \
|
||||
struct NAME##RVNonExtFeatureValue : public RVNonExtFeatureValue { \
|
||||
NAME##RVNonExtFeatureValue() : \
|
||||
#define DECLARE_RV_NON_EXT_FEATURE(PRETTY, LINUX_BIT, FSTRING, FLAGF) \
|
||||
struct PRETTY##RVNonExtFeatureValue : public RVNonExtFeatureValue { \
|
||||
PRETTY##RVNonExtFeatureValue() : \
|
||||
RVNonExtFeatureValue(#PRETTY, LINUX_BIT, FSTRING) {} \
|
||||
FLAGF; \
|
||||
}; \
|
||||
static NAME##RVNonExtFeatureValue NAME; \
|
||||
static PRETTY##RVNonExtFeatureValue PRETTY; \
|
||||
|
||||
RV_NON_EXT_FEATURE_FLAGS(DECLARE_RV_NON_EXT_FEATURE)
|
||||
#undef DECLARE_RV_NON_EXT_FEATURE
|
||||
@@ -274,7 +308,7 @@ private:
|
||||
class RVExtFeatures : public CHeapObj<mtCode> {
|
||||
public:
|
||||
enum RVFeatureIndex {
|
||||
#define DECLARE_RV_FEATURE_ENUM(NAME, PRETTY, LINUX_BIT, FSTRING, FLAGF) CPU_##NAME,
|
||||
#define DECLARE_RV_FEATURE_ENUM(PRETTY, LINUX_BIT, FSTRING, FLAGF) CPU_##ext_##PRETTY,
|
||||
|
||||
RV_EXT_FEATURE_FLAGS(DECLARE_RV_FEATURE_ENUM)
|
||||
MAX_CPU_FEATURE_INDEX
|
||||
@@ -396,12 +430,19 @@ private:
|
||||
static VM_MODE parse_satp_mode(const char* vm_mode);
|
||||
|
||||
// Values from riscv_hwprobe()
|
||||
enum UNALIGNED_ACCESS : int {
|
||||
MISALIGNED_UNKNOWN = 0,
|
||||
MISALIGNED_EMULATED = 1,
|
||||
MISALIGNED_SLOW = 2,
|
||||
MISALIGNED_FAST = 3,
|
||||
MISALIGNED_UNSUPPORTED = 4
|
||||
enum UNALIGNED_SCALAR_ACCESS : int {
|
||||
MISALIGNED_SCALAR_UNKNOWN = 0,
|
||||
MISALIGNED_SCALAR_EMULATED = 1,
|
||||
MISALIGNED_SCALAR_SLOW = 2,
|
||||
MISALIGNED_SCALAR_FAST = 3,
|
||||
MISALIGNED_SCALAR_UNSUPPORTED = 4
|
||||
};
|
||||
|
||||
enum UNALIGNED_VECTOR_ACCESS : int {
|
||||
MISALIGNED_VECTOR_UNKNOWN = 0,
|
||||
MISALIGNED_VECTOR_SLOW = 2,
|
||||
MISALIGNED_VECTOR_FAST = 3,
|
||||
MISALIGNED_VECTOR_UNSUPPORTED = 4
|
||||
};
|
||||
|
||||
// Null terminated list
|
||||
|
||||
@@ -282,13 +282,6 @@ LIR_Opr FrameMap::stack_pointer() {
|
||||
return Z_SP_opr;
|
||||
}
|
||||
|
||||
// JSR 292
|
||||
// On ZARCH_64, there is no need to save the SP, because neither
|
||||
// method handle intrinsics nor compiled lambda forms modify it.
|
||||
LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() {
|
||||
return LIR_OprFact::illegalOpr;
|
||||
}
|
||||
|
||||
bool FrameMap::validate_frame() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1980,11 +1980,6 @@ RegMask Matcher::modL_proj_mask() {
|
||||
return _Z_RARG3_LONG_REG_mask;
|
||||
}
|
||||
|
||||
// Copied from sparc.
|
||||
const RegMask Matcher::method_handle_invoke_SP_save_mask() {
|
||||
return RegMask();
|
||||
}
|
||||
|
||||
// Should the matcher clone input 'm' of node 'n'?
|
||||
bool Matcher::pd_clone_node(Node* n, Node* m, Matcher::MStack& mstack) {
|
||||
if (is_encode_and_store_pattern(n, m)) {
|
||||
|
||||
@@ -2225,6 +2225,44 @@ void Assembler::cvttss2sil(Register dst, XMMRegister src) {
|
||||
emit_int16(0x2C, (0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::evcvttss2sisl(Register dst, XMMRegister src) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_is_evex_instruction();
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int16(0x6D, (0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::evcvttss2sisl(Register dst, Address src) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit);
|
||||
attributes.set_is_evex_instruction();
|
||||
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int8((unsigned char)0x6D);
|
||||
emit_operand(dst, src, 0);
|
||||
}
|
||||
|
||||
void Assembler::evcvttss2sisq(Register dst, XMMRegister src) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_is_evex_instruction();
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int16(0x6D, (0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::evcvttss2sisq(Register dst, Address src) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit);
|
||||
attributes.set_is_evex_instruction();
|
||||
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int8((unsigned char)0x6D);
|
||||
emit_operand(dst, src, 0);
|
||||
}
|
||||
|
||||
void Assembler::cvttpd2dq(XMMRegister dst, XMMRegister src) {
|
||||
int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit;
|
||||
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
@@ -2310,6 +2348,25 @@ void Assembler::vcvttps2dq(XMMRegister dst, XMMRegister src, int vector_len) {
|
||||
emit_int16(0x5B, (0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::evcvttps2dqs(XMMRegister dst, XMMRegister src, int vector_len) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
attributes.set_is_evex_instruction();
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int16(0x6D, (0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::evcvttps2dqs(XMMRegister dst, Address src, int vector_len) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit);
|
||||
attributes.set_is_evex_instruction();
|
||||
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int8((unsigned char)0x6D);
|
||||
emit_operand(dst, src, 0);
|
||||
}
|
||||
|
||||
void Assembler::vcvttpd2dq(XMMRegister dst, XMMRegister src, int vector_len) {
|
||||
assert(vector_len <= AVX_256bit ? VM_Version::supports_avx() : VM_Version::supports_evex(), "");
|
||||
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
@@ -2317,6 +2374,25 @@ void Assembler::vcvttpd2dq(XMMRegister dst, XMMRegister src, int vector_len) {
|
||||
emit_int16((unsigned char)0xE6, (0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::evcvttpd2dqs(XMMRegister dst, XMMRegister src, int vector_len) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
attributes.set_is_evex_instruction();
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int16(0x6D, (0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::evcvttpd2dqs(XMMRegister dst, Address src, int vector_len) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
|
||||
attributes.set_is_evex_instruction();
|
||||
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int8((unsigned char)0x6D);
|
||||
emit_operand(dst, src, 0);
|
||||
}
|
||||
|
||||
void Assembler::vcvtps2dq(XMMRegister dst, XMMRegister src, int vector_len) {
|
||||
assert(vector_len <= AVX_256bit ? VM_Version::supports_avx() : VM_Version::supports_evex(), "");
|
||||
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
@@ -2332,6 +2408,25 @@ void Assembler::evcvttps2qq(XMMRegister dst, XMMRegister src, int vector_len) {
|
||||
emit_int16(0x7A, (0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::evcvttps2qqs(XMMRegister dst, XMMRegister src, int vector_len) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
attributes.set_is_evex_instruction();
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int16(0x6D, (0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::evcvttps2qqs(XMMRegister dst, Address src, int vector_len) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_HV, /* input_size_in_bits */ EVEX_32bit);
|
||||
attributes.set_is_evex_instruction();
|
||||
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int8((unsigned char)0x6D);
|
||||
emit_operand(dst, src, 0);
|
||||
}
|
||||
|
||||
void Assembler::evcvtpd2qq(XMMRegister dst, XMMRegister src, int vector_len) {
|
||||
assert(VM_Version::supports_avx512dq(), "");
|
||||
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
@@ -2356,6 +2451,25 @@ void Assembler::evcvttpd2qq(XMMRegister dst, XMMRegister src, int vector_len) {
|
||||
emit_int16(0x7A, (0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::evcvttpd2qqs(XMMRegister dst, XMMRegister src, int vector_len) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
attributes.set_is_evex_instruction();
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int16(0x6D, (0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::evcvttpd2qqs(XMMRegister dst, Address src, int vector_len) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
|
||||
attributes.set_is_evex_instruction();
|
||||
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int8((unsigned char)0x6D);
|
||||
emit_operand(dst, src, 0);
|
||||
}
|
||||
|
||||
void Assembler::evcvtqq2pd(XMMRegister dst, XMMRegister src, int vector_len) {
|
||||
assert(VM_Version::supports_avx512dq(), "");
|
||||
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
|
||||
@@ -14988,6 +15102,44 @@ void Assembler::cvttsd2siq(Register dst, Address src) {
|
||||
emit_operand(dst, src, 0);
|
||||
}
|
||||
|
||||
void Assembler::evcvttsd2sisl(Register dst, XMMRegister src) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_is_evex_instruction();
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int16(0x6D, (0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::evcvttsd2sisl(Register dst, Address src) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit);
|
||||
attributes.set_is_evex_instruction();
|
||||
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int8((unsigned char)0x6D);
|
||||
emit_operand(dst, src, 0);
|
||||
}
|
||||
|
||||
void Assembler::evcvttsd2sisq(Register dst, XMMRegister src) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_is_evex_instruction();
|
||||
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int16(0x6D, (0xC0 | encode));
|
||||
}
|
||||
|
||||
void Assembler::evcvttsd2sisq(Register dst, Address src) {
|
||||
assert(VM_Version::supports_avx10_2(), "");
|
||||
InstructionMark im(this);
|
||||
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit);
|
||||
attributes.set_is_evex_instruction();
|
||||
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_MAP5, &attributes);
|
||||
emit_int8((unsigned char)0x6D);
|
||||
emit_operand(dst, src, 0);
|
||||
}
|
||||
|
||||
void Assembler::cvttsd2siq(Register dst, XMMRegister src) {
|
||||
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
|
||||
int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes);
|
||||
|
||||
@@ -1316,11 +1316,19 @@ private:
|
||||
void cvttsd2sil(Register dst, XMMRegister src);
|
||||
void cvttsd2siq(Register dst, Address src);
|
||||
void cvttsd2siq(Register dst, XMMRegister src);
|
||||
void evcvttsd2sisl(Register dst, XMMRegister src);
|
||||
void evcvttsd2sisl(Register dst, Address src);
|
||||
void evcvttsd2sisq(Register dst, XMMRegister src);
|
||||
void evcvttsd2sisq(Register dst, Address src);
|
||||
|
||||
// Convert with Truncation Scalar Single-Precision Floating-Point Value to Doubleword Integer
|
||||
void cvttss2sil(Register dst, XMMRegister src);
|
||||
void cvttss2siq(Register dst, XMMRegister src);
|
||||
void cvtss2sil(Register dst, XMMRegister src);
|
||||
void evcvttss2sisl(Register dst, XMMRegister src);
|
||||
void evcvttss2sisl(Register dst, Address src);
|
||||
void evcvttss2sisq(Register dst, XMMRegister src);
|
||||
void evcvttss2sisq(Register dst, Address src);
|
||||
|
||||
// Convert vector double to int
|
||||
void cvttpd2dq(XMMRegister dst, XMMRegister src);
|
||||
@@ -1332,7 +1340,11 @@ private:
|
||||
// Convert vector float to int/long
|
||||
void vcvtps2dq(XMMRegister dst, XMMRegister src, int vector_len);
|
||||
void vcvttps2dq(XMMRegister dst, XMMRegister src, int vector_len);
|
||||
void evcvttps2dqs(XMMRegister dst, XMMRegister src, int vector_len);
|
||||
void evcvttps2dqs(XMMRegister dst, Address src, int vector_len);
|
||||
void evcvttps2qq(XMMRegister dst, XMMRegister src, int vector_len);
|
||||
void evcvttps2qqs(XMMRegister dst, XMMRegister src, int vector_len);
|
||||
void evcvttps2qqs(XMMRegister dst, Address src, int vector_len);
|
||||
|
||||
// Convert vector long to vector FP
|
||||
void evcvtqq2ps(XMMRegister dst, XMMRegister src, int vector_len);
|
||||
@@ -1341,9 +1353,13 @@ private:
|
||||
// Convert vector double to long
|
||||
void evcvtpd2qq(XMMRegister dst, XMMRegister src, int vector_len);
|
||||
void evcvttpd2qq(XMMRegister dst, XMMRegister src, int vector_len);
|
||||
void evcvttpd2qqs(XMMRegister dst, XMMRegister src, int vector_len);
|
||||
void evcvttpd2qqs(XMMRegister dst, Address src, int vector_len);
|
||||
|
||||
// Convert vector double to int
|
||||
void vcvttpd2dq(XMMRegister dst, XMMRegister src, int vector_len);
|
||||
void evcvttpd2dqs(XMMRegister dst, XMMRegister src, int vector_len);
|
||||
void evcvttpd2dqs(XMMRegister dst, Address src, int vector_len);
|
||||
|
||||
// Evex casts with truncation
|
||||
void evpmovwb(XMMRegister dst, XMMRegister src, int vector_len);
|
||||
|
||||
@@ -326,13 +326,6 @@ LIR_Opr FrameMap::stack_pointer() {
|
||||
return FrameMap::rsp_opr;
|
||||
}
|
||||
|
||||
// JSR 292
|
||||
// On x86, there is no need to save the SP, because neither
|
||||
// method handle intrinsics, nor compiled lambda forms modify it.
|
||||
LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() {
|
||||
return LIR_OprFact::illegalOpr;
|
||||
}
|
||||
|
||||
bool FrameMap::validate_frame() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5053,12 +5053,12 @@ void C2_MacroAssembler::vector_cast_int_to_subword(BasicType to_elem_bt, XMMRegi
|
||||
}
|
||||
vpackuswb(dst, dst, zero, vec_enc);
|
||||
break;
|
||||
default: assert(false, "%s", type2name(to_elem_bt));
|
||||
default: assert(false, "Unexpected basic type for target of vector cast int to subword: %s", type2name(to_elem_bt));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Algorithm for vector D2L and F2I conversions:-
|
||||
* Algorithm for vector D2L and F2I conversions (AVX 10.2 unsupported):-
|
||||
* a) Perform vector D2L/F2I cast.
|
||||
* b) Choose fast path if none of the result vector lane contains 0x80000000 value.
|
||||
* It signifies that source value could be any of the special floating point
|
||||
@@ -5096,7 +5096,7 @@ void C2_MacroAssembler::vector_castF2X_evex(BasicType to_elem_bt, XMMRegister ds
|
||||
case T_BYTE:
|
||||
evpmovdb(dst, dst, vec_enc);
|
||||
break;
|
||||
default: assert(false, "%s", type2name(to_elem_bt));
|
||||
default: assert(false, "Unexpected basic type for target of vector castF2X EVEX: %s", type2name(to_elem_bt));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5143,7 +5143,7 @@ void C2_MacroAssembler::vector_castD2X_evex(BasicType to_elem_bt, XMMRegister ds
|
||||
evpmovsqd(dst, dst, vec_enc);
|
||||
evpmovdb(dst, dst, vec_enc);
|
||||
break;
|
||||
default: assert(false, "%s", type2name(to_elem_bt));
|
||||
default: assert(false, "Unexpected basic type for target of vector castD2X AVX512DQ EVEX: %s", type2name(to_elem_bt));
|
||||
}
|
||||
} else {
|
||||
assert(type2aelembytes(to_elem_bt) <= 4, "");
|
||||
@@ -5158,11 +5158,91 @@ void C2_MacroAssembler::vector_castD2X_evex(BasicType to_elem_bt, XMMRegister ds
|
||||
case T_BYTE:
|
||||
evpmovdb(dst, dst, vec_enc);
|
||||
break;
|
||||
default: assert(false, "%s", type2name(to_elem_bt));
|
||||
default: assert(false, "Unexpected basic type for target of vector castD2X EVEX: %s", type2name(to_elem_bt));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::vector_castF2X_avx10(BasicType to_elem_bt, XMMRegister dst, XMMRegister src, int vec_enc) {
|
||||
switch(to_elem_bt) {
|
||||
case T_LONG:
|
||||
evcvttps2qqs(dst, src, vec_enc);
|
||||
break;
|
||||
case T_INT:
|
||||
evcvttps2dqs(dst, src, vec_enc);
|
||||
break;
|
||||
case T_SHORT:
|
||||
evcvttps2dqs(dst, src, vec_enc);
|
||||
evpmovdw(dst, dst, vec_enc);
|
||||
break;
|
||||
case T_BYTE:
|
||||
evcvttps2dqs(dst, src, vec_enc);
|
||||
evpmovdb(dst, dst, vec_enc);
|
||||
break;
|
||||
default: assert(false, "Unexpected basic type for target of vector castF2X AVX10 (reg src): %s", type2name(to_elem_bt));
|
||||
}
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::vector_castF2X_avx10(BasicType to_elem_bt, XMMRegister dst, Address src, int vec_enc) {
|
||||
switch(to_elem_bt) {
|
||||
case T_LONG:
|
||||
evcvttps2qqs(dst, src, vec_enc);
|
||||
break;
|
||||
case T_INT:
|
||||
evcvttps2dqs(dst, src, vec_enc);
|
||||
break;
|
||||
case T_SHORT:
|
||||
evcvttps2dqs(dst, src, vec_enc);
|
||||
evpmovdw(dst, dst, vec_enc);
|
||||
break;
|
||||
case T_BYTE:
|
||||
evcvttps2dqs(dst, src, vec_enc);
|
||||
evpmovdb(dst, dst, vec_enc);
|
||||
break;
|
||||
default: assert(false, "Unexpected basic type for target of vector castF2X AVX10 (mem src): %s", type2name(to_elem_bt));
|
||||
}
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::vector_castD2X_avx10(BasicType to_elem_bt, XMMRegister dst, XMMRegister src, int vec_enc) {
|
||||
switch(to_elem_bt) {
|
||||
case T_LONG:
|
||||
evcvttpd2qqs(dst, src, vec_enc);
|
||||
break;
|
||||
case T_INT:
|
||||
evcvttpd2dqs(dst, src, vec_enc);
|
||||
break;
|
||||
case T_SHORT:
|
||||
evcvttpd2dqs(dst, src, vec_enc);
|
||||
evpmovdw(dst, dst, vec_enc);
|
||||
break;
|
||||
case T_BYTE:
|
||||
evcvttpd2dqs(dst, src, vec_enc);
|
||||
evpmovdb(dst, dst, vec_enc);
|
||||
break;
|
||||
default: assert(false, "Unexpected basic type for target of vector castD2X AVX10 (reg src): %s", type2name(to_elem_bt));
|
||||
}
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::vector_castD2X_avx10(BasicType to_elem_bt, XMMRegister dst, Address src, int vec_enc) {
|
||||
switch(to_elem_bt) {
|
||||
case T_LONG:
|
||||
evcvttpd2qqs(dst, src, vec_enc);
|
||||
break;
|
||||
case T_INT:
|
||||
evcvttpd2dqs(dst, src, vec_enc);
|
||||
break;
|
||||
case T_SHORT:
|
||||
evcvttpd2dqs(dst, src, vec_enc);
|
||||
evpmovdw(dst, dst, vec_enc);
|
||||
break;
|
||||
case T_BYTE:
|
||||
evcvttpd2dqs(dst, src, vec_enc);
|
||||
evpmovdb(dst, dst, vec_enc);
|
||||
break;
|
||||
default: assert(false, "Unexpected basic type for target of vector castD2X AVX10 (mem src): %s", type2name(to_elem_bt));
|
||||
}
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::vector_round_double_evex(XMMRegister dst, XMMRegister src,
|
||||
AddressLiteral double_sign_flip, AddressLiteral new_mxcsr, int vec_enc,
|
||||
Register tmp, XMMRegister xtmp1, XMMRegister xtmp2, KRegister ktmp1, KRegister ktmp2) {
|
||||
|
||||
@@ -347,6 +347,13 @@ public:
|
||||
XMMRegister xtmp2, XMMRegister xtmp3, XMMRegister xtmp4, XMMRegister xtmp5,
|
||||
AddressLiteral float_sign_flip, Register rscratch, int vec_enc);
|
||||
|
||||
void vector_castF2X_avx10(BasicType to_elem_bt, XMMRegister dst, XMMRegister src, int vec_enc);
|
||||
|
||||
void vector_castF2X_avx10(BasicType to_elem_bt, XMMRegister dst, Address src, int vec_enc);
|
||||
|
||||
void vector_castD2X_avx10(BasicType to_elem_bt, XMMRegister dst, XMMRegister src, int vec_enc);
|
||||
|
||||
void vector_castD2X_avx10(BasicType to_elem_bt, XMMRegister dst, Address src, int vec_enc);
|
||||
|
||||
void vector_cast_double_to_int_special_cases_avx(XMMRegister dst, XMMRegister src, XMMRegister xtmp1, XMMRegister xtmp2,
|
||||
XMMRegister xtmp3, XMMRegister xtmp4, XMMRegister xtmp5, Register rscratch,
|
||||
|
||||
@@ -219,8 +219,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
|
||||
|
||||
nmethod* nm = sender_blob->as_nmethod_or_null();
|
||||
if (nm != nullptr) {
|
||||
if (nm->is_deopt_mh_entry(sender_pc) || nm->is_deopt_entry(sender_pc) ||
|
||||
nm->method()->is_method_handle_intrinsic()) {
|
||||
if (nm->is_deopt_entry(sender_pc) || nm->method()->is_method_handle_intrinsic()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -443,47 +442,6 @@ JavaThread** frame::saved_thread_address(const frame& f) {
|
||||
return thread_addr;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::verify_deopt_original_pc
|
||||
//
|
||||
// Verifies the calculated original PC of a deoptimization PC for the
|
||||
// given unextended SP.
|
||||
#ifdef ASSERT
|
||||
void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp) {
|
||||
frame fr;
|
||||
|
||||
// This is ugly but it's better than to change {get,set}_original_pc
|
||||
// to take an SP value as argument. And it's only a debugging
|
||||
// method anyway.
|
||||
fr._unextended_sp = unextended_sp;
|
||||
|
||||
address original_pc = nm->get_original_pc(&fr);
|
||||
assert(nm->insts_contains_inclusive(original_pc),
|
||||
"original PC must be in the main code section of the compiled method (or must be immediately following it) original_pc: " INTPTR_FORMAT " unextended_sp: " INTPTR_FORMAT " name: %s", p2i(original_pc), p2i(unextended_sp), nm->name());
|
||||
}
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::adjust_unextended_sp
|
||||
#ifdef ASSERT
|
||||
void frame::adjust_unextended_sp() {
|
||||
// On x86, sites calling method handle intrinsics and lambda forms are treated
|
||||
// as any other call site. Therefore, no special action is needed when we are
|
||||
// returning to any of these call sites.
|
||||
|
||||
if (_cb != nullptr) {
|
||||
nmethod* sender_nm = _cb->as_nmethod_or_null();
|
||||
if (sender_nm != nullptr) {
|
||||
// If the sender PC is a deoptimization point, get the original PC.
|
||||
if (sender_nm->is_deopt_entry(_pc) ||
|
||||
sender_nm->is_deopt_mh_entry(_pc)) {
|
||||
verify_deopt_original_pc(sender_nm, _unextended_sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// frame::sender_for_interpreter_frame
|
||||
frame frame::sender_for_interpreter_frame(RegisterMap* map) const {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2025, 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
|
||||
@@ -138,17 +138,10 @@
|
||||
int _offset_unextended_sp; // for use in stack-chunk frames
|
||||
};
|
||||
|
||||
void adjust_unextended_sp() NOT_DEBUG_RETURN;
|
||||
|
||||
intptr_t* ptr_at_addr(int offset) const {
|
||||
return (intptr_t*) addr_at(offset);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
// Used in frame::sender_for_{interpreter,compiled}_frame
|
||||
static void verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp);
|
||||
#endif
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
|
||||
|
||||
@@ -111,8 +111,6 @@ inline void frame::init(intptr_t* sp, intptr_t* fp, address pc) {
|
||||
}
|
||||
|
||||
inline void frame::setup(address pc) {
|
||||
adjust_unextended_sp();
|
||||
|
||||
address original_pc = get_deopt_original_pc();
|
||||
if (original_pc != nullptr) {
|
||||
_pc = original_pc;
|
||||
@@ -209,7 +207,6 @@ inline frame::frame(intptr_t* sp, intptr_t* fp) {
|
||||
// assert(_pc != nullptr, "no pc?");
|
||||
|
||||
_cb = CodeCache::find_blob(_pc);
|
||||
adjust_unextended_sp();
|
||||
|
||||
address original_pc = get_deopt_original_pc();
|
||||
if (original_pc != nullptr) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2025, 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
|
||||
@@ -34,8 +34,6 @@ const bool CCallingConventionRequiresIntsAsLongs = false;
|
||||
|
||||
#define SUPPORTS_NATIVE_CX8
|
||||
|
||||
#define SUPPORT_MONITOR_COUNT
|
||||
|
||||
#define CPU_MULTI_COPY_ATOMIC
|
||||
|
||||
// The expected size in bytes of a cache line.
|
||||
|
||||
@@ -2431,14 +2431,6 @@ void MacroAssembler::pop_cont_fastpath() {
|
||||
bind(L_done);
|
||||
}
|
||||
|
||||
void MacroAssembler::inc_held_monitor_count() {
|
||||
incrementq(Address(r15_thread, JavaThread::held_monitor_count_offset()));
|
||||
}
|
||||
|
||||
void MacroAssembler::dec_held_monitor_count() {
|
||||
decrementq(Address(r15_thread, JavaThread::held_monitor_count_offset()));
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
void MacroAssembler::stop_if_in_cont(Register cont, const char* name) {
|
||||
Label no_cont;
|
||||
@@ -5847,7 +5839,7 @@ void MacroAssembler::generate_fill(BasicType t, bool aligned,
|
||||
orl(value, rtmp);
|
||||
}
|
||||
|
||||
cmpptr(count, 2<<shift); // Short arrays (< 8 bytes) fill by element
|
||||
cmpptr(count, 8 << shift); // Short arrays (< 32 bytes) fill by element
|
||||
jcc(Assembler::below, L_fill_4_bytes); // use unsigned cmp
|
||||
if (!UseUnalignedLoadStores && !aligned && (t == T_BYTE || t == T_SHORT)) {
|
||||
Label L_skip_align2;
|
||||
@@ -5910,13 +5902,36 @@ void MacroAssembler::generate_fill(BasicType t, bool aligned,
|
||||
BIND(L_check_fill_64_bytes_avx2);
|
||||
}
|
||||
// Fill 64-byte chunks
|
||||
Label L_fill_64_bytes_loop;
|
||||
vpbroadcastd(xtmp, xtmp, Assembler::AVX_256bit);
|
||||
|
||||
subptr(count, 16 << shift);
|
||||
jcc(Assembler::less, L_check_fill_32_bytes);
|
||||
align(16);
|
||||
|
||||
// align data for 64-byte chunks
|
||||
Label L_fill_64_bytes_loop, L_align_64_bytes_loop;
|
||||
if (EnableX86ECoreOpts) {
|
||||
// align 'big' arrays to cache lines to minimize split_stores
|
||||
cmpptr(count, 96 << shift);
|
||||
jcc(Assembler::below, L_fill_64_bytes_loop);
|
||||
|
||||
// Find the bytes needed for alignment
|
||||
movptr(rtmp, to);
|
||||
andptr(rtmp, 0x1c);
|
||||
jcc(Assembler::zero, L_fill_64_bytes_loop);
|
||||
negptr(rtmp); // number of bytes to fill 32-rtmp. it filled by 2 mov by 32
|
||||
addptr(rtmp, 32);
|
||||
shrptr(rtmp, 2 - shift);// get number of elements from bytes
|
||||
subptr(count, rtmp); // adjust count by number of elements
|
||||
|
||||
align(16);
|
||||
BIND(L_align_64_bytes_loop);
|
||||
movdl(Address(to, 0), xtmp);
|
||||
addptr(to, 4);
|
||||
subptr(rtmp, 1 << shift);
|
||||
jcc(Assembler::greater, L_align_64_bytes_loop);
|
||||
}
|
||||
|
||||
align(16);
|
||||
BIND(L_fill_64_bytes_loop);
|
||||
vmovdqu(Address(to, 0), xtmp);
|
||||
vmovdqu(Address(to, 32), xtmp);
|
||||
@@ -5924,6 +5939,7 @@ void MacroAssembler::generate_fill(BasicType t, bool aligned,
|
||||
subptr(count, 16 << shift);
|
||||
jcc(Assembler::greaterEqual, L_fill_64_bytes_loop);
|
||||
|
||||
align(16);
|
||||
BIND(L_check_fill_32_bytes);
|
||||
addptr(count, 8 << shift);
|
||||
jccb(Assembler::less, L_check_fill_8_bytes);
|
||||
@@ -5968,6 +5984,7 @@ void MacroAssembler::generate_fill(BasicType t, bool aligned,
|
||||
//
|
||||
// length is too short, just fill qwords
|
||||
//
|
||||
align(16);
|
||||
BIND(L_fill_8_bytes_loop);
|
||||
movq(Address(to, 0), xtmp);
|
||||
addptr(to, 8);
|
||||
@@ -5976,14 +5993,22 @@ void MacroAssembler::generate_fill(BasicType t, bool aligned,
|
||||
jcc(Assembler::greaterEqual, L_fill_8_bytes_loop);
|
||||
}
|
||||
}
|
||||
// fill trailing 4 bytes
|
||||
BIND(L_fill_4_bytes);
|
||||
testl(count, 1<<shift);
|
||||
|
||||
Label L_fill_4_bytes_loop;
|
||||
testl(count, 1 << shift);
|
||||
jccb(Assembler::zero, L_fill_2_bytes);
|
||||
|
||||
align(16);
|
||||
BIND(L_fill_4_bytes_loop);
|
||||
movl(Address(to, 0), value);
|
||||
addptr(to, 4);
|
||||
|
||||
BIND(L_fill_4_bytes);
|
||||
subptr(count, 1 << shift);
|
||||
jccb(Assembler::greaterEqual, L_fill_4_bytes_loop);
|
||||
|
||||
if (t == T_BYTE || t == T_SHORT) {
|
||||
Label L_fill_byte;
|
||||
addptr(to, 4);
|
||||
BIND(L_fill_2_bytes);
|
||||
// fill trailing 2 bytes
|
||||
testl(count, 1<<(shift-1));
|
||||
|
||||
@@ -472,9 +472,6 @@ class MacroAssembler: public Assembler {
|
||||
void push_cont_fastpath();
|
||||
void pop_cont_fastpath();
|
||||
|
||||
void inc_held_monitor_count();
|
||||
void dec_held_monitor_count();
|
||||
|
||||
DEBUG_ONLY(void stop_if_in_cont(Register cont_reg, const char* name);)
|
||||
|
||||
// Round up to a power of two
|
||||
|
||||
@@ -23,67 +23,24 @@
|
||||
*/
|
||||
|
||||
#include "rdtsc_x86.hpp"
|
||||
#include "runtime/atomicAccess.hpp"
|
||||
#include "runtime/globals_extension.hpp"
|
||||
#include "runtime/javaThread.hpp"
|
||||
#include "runtime/os.inline.hpp"
|
||||
#include "runtime/orderAccess.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#include "vm_version_x86.hpp"
|
||||
|
||||
static jlong _epoch = 0;
|
||||
static bool rdtsc_elapsed_counter_enabled = false;
|
||||
static jlong tsc_frequency = 0;
|
||||
DEBUG_ONLY(volatile int Rdtsc::_initialized = 0;)
|
||||
jlong Rdtsc::_epoch = 0;
|
||||
jlong Rdtsc::_tsc_frequency = 0;
|
||||
|
||||
static jlong set_epoch() {
|
||||
jlong Rdtsc::set_epoch() {
|
||||
assert(0 == _epoch, "invariant");
|
||||
_epoch = os::rdtsc();
|
||||
return _epoch;
|
||||
}
|
||||
|
||||
// Base loop to estimate ticks frequency for tsc counter from user mode.
|
||||
// Volatiles and sleep() are used to prevent compiler from applying optimizations.
|
||||
static void do_time_measurements(volatile jlong& time_base,
|
||||
volatile jlong& time_fast,
|
||||
volatile jlong& time_base_elapsed,
|
||||
volatile jlong& time_fast_elapsed) {
|
||||
static const unsigned int FT_SLEEP_MILLISECS = 1;
|
||||
const unsigned int loopcount = 3;
|
||||
|
||||
volatile jlong start = 0;
|
||||
volatile jlong fstart = 0;
|
||||
volatile jlong end = 0;
|
||||
volatile jlong fend = 0;
|
||||
|
||||
// Figure out the difference between rdtsc and os provided timer.
|
||||
// base algorithm adopted from JRockit.
|
||||
for (unsigned int times = 0; times < loopcount; times++) {
|
||||
start = os::elapsed_counter();
|
||||
OrderAccess::fence();
|
||||
fstart = os::rdtsc();
|
||||
|
||||
// use sleep to prevent compiler from optimizing
|
||||
JavaThread::current()->sleep(FT_SLEEP_MILLISECS);
|
||||
|
||||
end = os::elapsed_counter();
|
||||
OrderAccess::fence();
|
||||
fend = os::rdtsc();
|
||||
|
||||
time_base += end - start;
|
||||
time_fast += fend - fstart;
|
||||
|
||||
// basis for calculating the os tick start
|
||||
// to fast time tick start offset
|
||||
time_base_elapsed += end;
|
||||
time_fast_elapsed += (fend - _epoch);
|
||||
}
|
||||
|
||||
time_base /= loopcount;
|
||||
time_fast /= loopcount;
|
||||
time_base_elapsed /= loopcount;
|
||||
time_fast_elapsed /= loopcount;
|
||||
}
|
||||
|
||||
static jlong initialize_frequency() {
|
||||
assert(0 == tsc_frequency, "invariant");
|
||||
jlong Rdtsc::initialize_frequency() {
|
||||
assert(0 == _tsc_frequency, "invariant");
|
||||
assert(0 == _epoch, "invariant");
|
||||
const jlong initial_counter = set_epoch();
|
||||
if (initial_counter == 0) {
|
||||
@@ -102,29 +59,6 @@ static jlong initialize_frequency() {
|
||||
// for invariant tsc platforms, take the maximum qualified cpu frequency
|
||||
tsc_freq = (double)VM_Version::maximum_qualified_cpu_frequency();
|
||||
os_to_tsc_conv_factor = tsc_freq / os_freq;
|
||||
} else {
|
||||
// use measurements to estimate
|
||||
// a conversion factor and the tsc frequency
|
||||
|
||||
volatile jlong time_base = 0;
|
||||
volatile jlong time_fast = 0;
|
||||
volatile jlong time_base_elapsed = 0;
|
||||
volatile jlong time_fast_elapsed = 0;
|
||||
|
||||
// do measurements to get base data
|
||||
// on os timer and fast ticks tsc time relation.
|
||||
do_time_measurements(time_base, time_fast, time_base_elapsed, time_fast_elapsed);
|
||||
|
||||
// if invalid measurements, cannot proceed
|
||||
if (time_fast == 0 || time_base == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
os_to_tsc_conv_factor = (double)time_fast / (double)time_base;
|
||||
if (os_to_tsc_conv_factor > 1) {
|
||||
// estimate on tsc counter frequency
|
||||
tsc_freq = os_to_tsc_conv_factor * os_freq;
|
||||
}
|
||||
}
|
||||
|
||||
if ((tsc_freq < 0) || (tsc_freq > 0 && tsc_freq <= os_freq) || (os_to_tsc_conv_factor <= 1)) {
|
||||
@@ -136,47 +70,52 @@ static jlong initialize_frequency() {
|
||||
return (jlong)tsc_freq;
|
||||
}
|
||||
|
||||
static bool initialize_elapsed_counter() {
|
||||
tsc_frequency = initialize_frequency();
|
||||
return tsc_frequency != 0 && _epoch != 0;
|
||||
bool Rdtsc::initialize_elapsed_counter() {
|
||||
_tsc_frequency = initialize_frequency();
|
||||
return _tsc_frequency != 0 && _epoch != 0;
|
||||
}
|
||||
|
||||
static bool ergonomics() {
|
||||
const bool invtsc_support = Rdtsc::is_supported();
|
||||
if (FLAG_IS_DEFAULT(UseFastUnorderedTimeStamps) && invtsc_support) {
|
||||
FLAG_SET_ERGO(UseFastUnorderedTimeStamps, true);
|
||||
}
|
||||
if (Rdtsc::is_supported()) {
|
||||
// Use rdtsc when it is supported by default
|
||||
FLAG_SET_ERGO_IF_DEFAULT(UseFastUnorderedTimeStamps, true);
|
||||
} else if (UseFastUnorderedTimeStamps) {
|
||||
assert(!FLAG_IS_DEFAULT(UseFastUnorderedTimeStamps), "Unexpected default value");
|
||||
|
||||
bool ft_enabled = UseFastUnorderedTimeStamps && invtsc_support;
|
||||
|
||||
if (!ft_enabled) {
|
||||
if (UseFastUnorderedTimeStamps && VM_Version::supports_tsc()) {
|
||||
warning("\nThe hardware does not support invariant tsc (INVTSC) register and/or cannot guarantee tsc synchronization between sockets at startup.\n"\
|
||||
"Values returned via rdtsc() are not guaranteed to be accurate, esp. when comparing values from cross sockets reads. Enabling UseFastUnorderedTimeStamps on non-invariant tsc hardware should be considered experimental.\n");
|
||||
ft_enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ft_enabled) {
|
||||
// Warn if unable to support command-line flag
|
||||
if (UseFastUnorderedTimeStamps && !VM_Version::supports_tsc()) {
|
||||
if (VM_Version::supports_tsc()) {
|
||||
warning("Ignoring UseFastUnorderedTimeStamps, the hardware does not support invariant tsc (INVTSC) register and/or cannot guarantee tsc synchronization between sockets at startup.\n"
|
||||
"Values returned via rdtsc() are not guaranteed to be accurate, esp. when comparing values from cross sockets reads.");
|
||||
} else {
|
||||
warning("Ignoring UseFastUnorderedTimeStamps, hardware does not support normal tsc");
|
||||
}
|
||||
|
||||
// We do not support non invariant rdtsc
|
||||
FLAG_SET_ERGO(UseFastUnorderedTimeStamps, false);
|
||||
}
|
||||
|
||||
return ft_enabled;
|
||||
return UseFastUnorderedTimeStamps;
|
||||
}
|
||||
|
||||
bool Rdtsc::initialize() {
|
||||
precond(AtomicAccess::xchg(&_initialized, 1) == 0);
|
||||
assert(0 == _tsc_frequency, "invariant");
|
||||
assert(0 == _epoch, "invariant");
|
||||
|
||||
if (!ergonomics()) {
|
||||
// We decided to ergonomically not support rdtsc.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Try to initialize the elapsed counter
|
||||
return initialize_elapsed_counter();
|
||||
}
|
||||
|
||||
bool Rdtsc::is_supported() {
|
||||
return VM_Version::supports_tscinv_ext();
|
||||
}
|
||||
|
||||
bool Rdtsc::is_elapsed_counter_enabled() {
|
||||
return rdtsc_elapsed_counter_enabled;
|
||||
}
|
||||
|
||||
jlong Rdtsc::frequency() {
|
||||
return tsc_frequency;
|
||||
return _tsc_frequency;
|
||||
}
|
||||
|
||||
jlong Rdtsc::elapsed_counter() {
|
||||
@@ -191,19 +130,7 @@ jlong Rdtsc::raw() {
|
||||
return os::rdtsc();
|
||||
}
|
||||
|
||||
bool Rdtsc::initialize() {
|
||||
static bool initialized = false;
|
||||
if (!initialized) {
|
||||
assert(!rdtsc_elapsed_counter_enabled, "invariant");
|
||||
VM_Version::initialize_tsc();
|
||||
assert(0 == tsc_frequency, "invariant");
|
||||
assert(0 == _epoch, "invariant");
|
||||
bool result = initialize_elapsed_counter(); // init hw
|
||||
if (result) {
|
||||
result = ergonomics(); // check logical state
|
||||
}
|
||||
rdtsc_elapsed_counter_enabled = result;
|
||||
initialized = true;
|
||||
}
|
||||
return rdtsc_elapsed_counter_enabled;
|
||||
bool Rdtsc::enabled() {
|
||||
static bool enabled = initialize();
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@@ -38,14 +38,24 @@
|
||||
// INVTSC is a minimal requirement for auto-enablement.
|
||||
|
||||
class Rdtsc : AllStatic {
|
||||
private:
|
||||
DEBUG_ONLY(static volatile int _initialized;)
|
||||
static jlong _epoch;
|
||||
static jlong _tsc_frequency;
|
||||
|
||||
static jlong set_epoch();
|
||||
|
||||
static jlong initialize_frequency();
|
||||
static bool initialize_elapsed_counter();
|
||||
static bool initialize();
|
||||
|
||||
public:
|
||||
static jlong elapsed_counter(); // provides quick time stamps
|
||||
static jlong frequency(); // tsc register
|
||||
static bool is_supported(); // InvariantTSC
|
||||
static jlong raw(); // direct rdtsc() access
|
||||
static bool is_elapsed_counter_enabled(); // turn off with -XX:-UseFastUnorderedTimeStamps
|
||||
static jlong epoch();
|
||||
static bool initialize();
|
||||
static bool enabled();
|
||||
};
|
||||
|
||||
#endif // CPU_X86_RDTSC_X86_HPP
|
||||
|
||||
@@ -1352,11 +1352,8 @@ static void fill_continuation_entry(MacroAssembler* masm, Register reg_cont_obj,
|
||||
|
||||
__ movptr(rax, Address(r15_thread, JavaThread::cont_fastpath_offset()));
|
||||
__ movptr(Address(rsp, ContinuationEntry::parent_cont_fastpath_offset()), rax);
|
||||
__ movq(rax, Address(r15_thread, JavaThread::held_monitor_count_offset()));
|
||||
__ movq(Address(rsp, ContinuationEntry::parent_held_monitor_count_offset()), rax);
|
||||
|
||||
__ movptr(Address(r15_thread, JavaThread::cont_fastpath_offset()), 0);
|
||||
__ movq(Address(r15_thread, JavaThread::held_monitor_count_offset()), 0);
|
||||
}
|
||||
|
||||
//---------------------------- continuation_enter_cleanup ---------------------------
|
||||
@@ -1380,49 +1377,6 @@ static void continuation_enter_cleanup(MacroAssembler* masm) {
|
||||
#endif
|
||||
__ movptr(rbx, Address(rsp, ContinuationEntry::parent_cont_fastpath_offset()));
|
||||
__ movptr(Address(r15_thread, JavaThread::cont_fastpath_offset()), rbx);
|
||||
|
||||
if (CheckJNICalls) {
|
||||
// Check if this is a virtual thread continuation
|
||||
Label L_skip_vthread_code;
|
||||
__ cmpl(Address(rsp, ContinuationEntry::flags_offset()), 0);
|
||||
__ jcc(Assembler::equal, L_skip_vthread_code);
|
||||
|
||||
// If the held monitor count is > 0 and this vthread is terminating then
|
||||
// it failed to release a JNI monitor. So we issue the same log message
|
||||
// that JavaThread::exit does.
|
||||
__ cmpptr(Address(r15_thread, JavaThread::jni_monitor_count_offset()), 0);
|
||||
__ jcc(Assembler::equal, L_skip_vthread_code);
|
||||
|
||||
// rax may hold an exception oop, save it before the call
|
||||
__ push(rax);
|
||||
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::log_jni_monitor_still_held));
|
||||
__ pop(rax);
|
||||
|
||||
// For vthreads we have to explicitly zero the JNI monitor count of the carrier
|
||||
// on termination. The held count is implicitly zeroed below when we restore from
|
||||
// the parent held count (which has to be zero).
|
||||
__ movq(Address(r15_thread, JavaThread::jni_monitor_count_offset()), 0);
|
||||
|
||||
__ bind(L_skip_vthread_code);
|
||||
}
|
||||
#ifdef ASSERT
|
||||
else {
|
||||
// Check if this is a virtual thread continuation
|
||||
Label L_skip_vthread_code;
|
||||
__ cmpl(Address(rsp, ContinuationEntry::flags_offset()), 0);
|
||||
__ jcc(Assembler::equal, L_skip_vthread_code);
|
||||
|
||||
// See comment just above. If not checking JNI calls the JNI count is only
|
||||
// needed for assertion checking.
|
||||
__ movq(Address(r15_thread, JavaThread::jni_monitor_count_offset()), 0);
|
||||
|
||||
__ bind(L_skip_vthread_code);
|
||||
}
|
||||
#endif
|
||||
|
||||
__ movq(rbx, Address(rsp, ContinuationEntry::parent_held_monitor_count_offset()));
|
||||
__ movq(Address(r15_thread, JavaThread::held_monitor_count_offset()), rbx);
|
||||
|
||||
__ movptr(rbx, Address(rsp, ContinuationEntry::parent_offset()));
|
||||
__ movptr(Address(r15_thread, JavaThread::cont_entry_offset()), rbx);
|
||||
__ addptr(rsp, checked_cast<int32_t>(ContinuationEntry::size()));
|
||||
|
||||
@@ -49,142 +49,142 @@
|
||||
/* Represents 0x7FFFFFFFFFFFFFFF double precision in lower 64 bits*/
|
||||
ATTRIBUTE_ALIGNED(16) static const juint _ABS_MASK[] =
|
||||
{
|
||||
4294967295, 2147483647, 0, 0
|
||||
0xFFFFFFFFUL, 0x7FFFFFFFUL, 0x00000000UL, 0x00000000UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _SIG_MASK[] =
|
||||
{
|
||||
0, 1032192
|
||||
0x00000000UL, 0x000FC000UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _EXP_MASK[] =
|
||||
{
|
||||
0, 3220176896
|
||||
0x00000000UL, 0xBFF00000UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _EXP_MSK2[] =
|
||||
{
|
||||
0, 3220193280
|
||||
0x00000000UL, 0xBFF04000UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _EXP_MSK3[] =
|
||||
{
|
||||
4294967295, 1048575
|
||||
0xFFFFFFFFUL, 0x000FFFFFUL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _SCALE63[] =
|
||||
{
|
||||
0, 1138753536
|
||||
0x00000000UL, 0x43E00000UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _ZERON[] =
|
||||
{
|
||||
0, 2147483648
|
||||
0x00000000UL, 0x80000000UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _INF[] =
|
||||
{
|
||||
0, 2146435072
|
||||
0x00000000UL, 0x7FF00000UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _NEG_INF[] =
|
||||
{
|
||||
0, 4293918720
|
||||
0x00000000UL, 0xFFF00000UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(16) static const juint _coeff_table[] =
|
||||
{
|
||||
1553778919, 3213899486, 3534952507, 3215266280, 1646371399,
|
||||
3214412045, 477218588, 3216798151, 3582521621, 1066628362,
|
||||
1007461464, 1068473053, 889629714, 1067378449, 1431655765,
|
||||
1070945621
|
||||
0x5C9CC8E7UL, 0xBF9036DEUL, 0xD2B3183BUL, 0xBFA511E8UL, 0x6221A247UL,
|
||||
0xBF98090DUL, 0x1C71C71CUL, 0xBFBC71C7UL, 0xD588F115UL, 0x3F93750AUL,
|
||||
0x3C0CA458UL, 0x3FAF9ADDUL, 0x3506AC12UL, 0x3F9EE711UL, 0x55555555UL,
|
||||
0x3FD55555UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _rcp_table[] =
|
||||
{
|
||||
528611360, 3220144632, 2884679527, 3220082993, 1991868891, 3220024928,
|
||||
2298714891, 3219970134, 58835168, 3219918343, 3035110223, 3219869313,
|
||||
1617585086, 3219822831, 2500867033, 3219778702, 4241943008, 3219736752,
|
||||
258732970, 3219696825, 404232216, 3219658776, 2172167368, 3219622476,
|
||||
1544257904, 3219587808, 377579543, 3219554664, 1616385542, 3219522945,
|
||||
813783277, 3219492562, 3940743189, 3219463431, 2689777499, 3219435478,
|
||||
1700977147, 3219408632, 3169102082, 3219382828, 327235604, 3219358008,
|
||||
1244336319, 3219334115, 1300311200, 3219311099, 3095471925, 3219288912,
|
||||
2166487928, 3219267511, 2913108253, 3219246854, 293672978, 3219226904,
|
||||
288737297, 3219207624, 1810275472, 3219188981, 174592167, 3219170945,
|
||||
3539053052, 3219153485, 2164392968, 3219136576
|
||||
0x1F81F820UL, 0xBFEF81F8UL, 0xABF0B767UL, 0xBFEE9131UL, 0x76B981DBUL, 0xBFEDAE60UL,
|
||||
0x89039B0BUL, 0xBFECD856UL, 0x0381C0E0UL, 0xBFEC0E07UL, 0xB4E81B4FUL, 0xBFEB4E81UL,
|
||||
0x606A63BEUL, 0xBFEA98EFUL, 0x951033D9UL, 0xBFE9EC8EUL, 0xFCD6E9E0UL, 0xBFE948B0UL,
|
||||
0x0F6BF3AAUL, 0xBFE8ACB9UL, 0x18181818UL, 0xBFE81818UL, 0x8178A4C8UL, 0xBFE78A4CUL,
|
||||
0x5C0B8170UL, 0xBFE702E0UL, 0x16816817UL, 0xBFE68168UL, 0x60581606UL, 0xBFE60581UL,
|
||||
0x308158EDUL, 0xBFE58ED2UL, 0xEAE2F815UL, 0xBFE51D07UL, 0xA052BF5BUL, 0xBFE4AFD6UL,
|
||||
0x6562D9FBUL, 0xBFE446F8UL, 0xBCE4A902UL, 0xBFE3E22CUL, 0x13813814UL, 0xBFE38138UL,
|
||||
0x4A2B10BFUL, 0xBFE323E3UL, 0x4D812CA0UL, 0xBFE2C9FBUL, 0xB8812735UL, 0xBFE27350UL,
|
||||
0x8121FB78UL, 0xBFE21FB7UL, 0xADA2811DUL, 0xBFE1CF06UL, 0x11811812UL, 0xBFE18118UL,
|
||||
0x1135C811UL, 0xBFE135C8UL, 0x6BE69C90UL, 0xBFE0ECF5UL, 0x0A6810A7UL, 0xBFE0A681UL,
|
||||
0xD2F1A9FCUL, 0xBFE0624DUL, 0x81020408UL, 0xBFE02040UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _cbrt_table[] =
|
||||
{
|
||||
572345495, 1072698681, 1998204467, 1072709382, 3861501553, 1072719872,
|
||||
2268192434, 1072730162, 2981979308, 1072740260, 270859143, 1072750176,
|
||||
2958651392, 1072759916, 313113243, 1072769490, 919449400, 1072778903,
|
||||
2809328903, 1072788162, 2222981587, 1072797274, 2352530781, 1072806244,
|
||||
594152517, 1072815078, 1555767199, 1072823780, 4282421314, 1072832355,
|
||||
2355578597, 1072840809, 1162590619, 1072849145, 797864051, 1072857367,
|
||||
431273680, 1072865479, 2669831148, 1072873484, 733477752, 1072881387,
|
||||
4280220604, 1072889189, 801961634, 1072896896, 2915370760, 1072904508,
|
||||
1159613482, 1072912030, 2689944798, 1072919463, 1248687822, 1072926811,
|
||||
2967951030, 1072934075, 630170432, 1072941259, 3760898254, 1072948363,
|
||||
0, 1072955392, 2370273294, 1072962345, 1261754802, 1072972640,
|
||||
546334065, 1072986123, 1054893830, 1072999340, 1571187597, 1073012304,
|
||||
1107975175, 1073025027, 3606909377, 1073037519, 1113616747, 1073049792,
|
||||
4154744632, 1073061853, 3358931423, 1073073713, 4060702372, 1073085379,
|
||||
747576176, 1073096860, 3023138255, 1073108161, 1419988548, 1073119291,
|
||||
1914185305, 1073130255, 294389948, 1073141060, 3761802570, 1073151710,
|
||||
978281566, 1073162213, 823148820, 1073172572, 2420954441, 1073182792,
|
||||
3815449908, 1073192878, 2046058587, 1073202835, 1807524753, 1073212666,
|
||||
2628681401, 1073222375, 3225667357, 1073231966, 1555307421, 1073241443,
|
||||
3454043099, 1073250808, 1208137896, 1073260066, 3659916772, 1073269218,
|
||||
1886261264, 1073278269, 3593647839, 1073287220, 3086012205, 1073296075,
|
||||
2769796922, 1073304836, 888716057, 1073317807, 2201465623, 1073334794,
|
||||
164369365, 1073351447, 3462666733, 1073367780, 2773905457, 1073383810,
|
||||
1342879088, 1073399550, 2543933975, 1073415012, 1684477781, 1073430209,
|
||||
3532178543, 1073445151, 1147747300, 1073459850, 1928031793, 1073474314,
|
||||
2079717015, 1073488553, 4016765315, 1073502575, 3670431139, 1073516389,
|
||||
3549227225, 1073530002, 11637607, 1073543422, 588220169, 1073556654,
|
||||
2635407503, 1073569705, 2042029317, 1073582582, 1925128962, 1073595290,
|
||||
4136375664, 1073607834, 759964600, 1073620221, 4257606771, 1073632453,
|
||||
297278907, 1073644538, 3655053093, 1073656477, 2442253172, 1073668277,
|
||||
1111876799, 1073679941, 3330973139, 1073691472, 3438879452, 1073702875,
|
||||
3671565478, 1073714153, 1317849547, 1073725310, 1642364115, 1073736348
|
||||
0x221D4C97UL, 0x3FF01539UL, 0x771A2E33UL, 0x3FF03F06UL, 0xE629D671UL, 0x3FF06800UL,
|
||||
0x8731DEB2UL, 0x3FF09032UL, 0xB1BD64ACUL, 0x3FF0B7A4UL, 0x1024FB87UL, 0x3FF0DE60UL,
|
||||
0xB0597000UL, 0x3FF1046CUL, 0x12A9BA9BUL, 0x3FF129D2UL, 0x36CDAF38UL, 0x3FF14E97UL,
|
||||
0xA772F507UL, 0x3FF172C2UL, 0x848001D3UL, 0x3FF1965AUL, 0x8C38C55DUL, 0x3FF1B964UL,
|
||||
0x236A0C45UL, 0x3FF1DBE6UL, 0x5CBB1F9FUL, 0x3FF1FDE4UL, 0xFF409042UL, 0x3FF21F63UL,
|
||||
0x8C6746E5UL, 0x3FF24069UL, 0x454BB99BUL, 0x3FF260F9UL, 0x2F8E7073UL, 0x3FF28117UL,
|
||||
0x19B4B6D0UL, 0x3FF2A0C7UL, 0x9F2263ECUL, 0x3FF2C00CUL, 0x2BB7FB78UL, 0x3FF2DEEBUL,
|
||||
0xFF1EFBBCUL, 0x3FF2FD65UL, 0x2FCCF6A2UL, 0x3FF31B80UL, 0xADC50708UL, 0x3FF3393CUL,
|
||||
0x451E4C2AUL, 0x3FF3569EUL, 0xA0554CDEUL, 0x3FF373A7UL, 0x4A6D76CEUL, 0x3FF3905BUL,
|
||||
0xB0E756B6UL, 0x3FF3ACBBUL, 0x258FA340UL, 0x3FF3C8CBUL, 0xE02AC0CEUL, 0x3FF3E48BUL,
|
||||
0x00000000UL, 0x3FF40000UL, 0x8D47800EUL, 0x3FF41B29UL, 0x4B34D9B2UL, 0x3FF44360UL,
|
||||
0x20906571UL, 0x3FF4780BUL, 0x3EE06706UL, 0x3FF4ABACUL, 0x5DA66B8DUL, 0x3FF4DE50UL,
|
||||
0x420A5C07UL, 0x3FF51003UL, 0xD6FD11C1UL, 0x3FF540CFUL, 0x4260716BUL, 0x3FF570C0UL,
|
||||
0xF7A45F38UL, 0x3FF59FDDUL, 0xC83539DFUL, 0x3FF5CE31UL, 0xF20966A4UL, 0x3FF5FBC3UL,
|
||||
0x2C8F1B70UL, 0x3FF6289CUL, 0xB4316DCFUL, 0x3FF654C1UL, 0x54A34E44UL, 0x3FF6803BUL,
|
||||
0x72182659UL, 0x3FF6AB0FUL, 0x118C08BCUL, 0x3FF6D544UL, 0xE0388D4AUL, 0x3FF6FEDEUL,
|
||||
0x3A4F645EUL, 0x3FF727E5UL, 0x31104114UL, 0x3FF7505CUL, 0x904CD549UL, 0x3FF77848UL,
|
||||
0xE36B2534UL, 0x3FF79FAEUL, 0x79F4605BUL, 0x3FF7C693UL, 0x6BBCA391UL, 0x3FF7ECFAUL,
|
||||
0x9CAE7EB9UL, 0x3FF812E7UL, 0xC043C71DUL, 0x3FF8385EUL, 0x5CB41B9DUL, 0x3FF85D63UL,
|
||||
0xCDE083DBUL, 0x3FF881F8UL, 0x4802B8A8UL, 0x3FF8A622UL, 0xDA25E5E4UL, 0x3FF8C9E2UL,
|
||||
0x706E1010UL, 0x3FF8ED3DUL, 0xD632B6DFUL, 0x3FF91034UL, 0xB7F0CF2DUL, 0x3FF932CBUL,
|
||||
0xA517BF3AUL, 0x3FF95504UL, 0x34F8BB19UL, 0x3FF987AFUL, 0x8337B317UL, 0x3FF9CA0AUL,
|
||||
0x09CC13D5UL, 0x3FFA0B17UL, 0xCE6419EDUL, 0x3FFA4AE4UL, 0xA5567031UL, 0x3FFA8982UL,
|
||||
0x500AB570UL, 0x3FFAC6FEUL, 0x97A15A17UL, 0x3FFB0364UL, 0x64671755UL, 0x3FFB3EC1UL,
|
||||
0xD288C46FUL, 0x3FFB791FUL, 0x44693BE4UL, 0x3FFBB28AUL, 0x72EB6E31UL, 0x3FFBEB0AUL,
|
||||
0x7BF5F697UL, 0x3FFC22A9UL, 0xEF6AF983UL, 0x3FFC596FUL, 0xDAC655A3UL, 0x3FFC8F65UL,
|
||||
0xD38CE8D9UL, 0x3FFCC492UL, 0x00B19367UL, 0x3FFCF8FEUL, 0x230F8709UL, 0x3FFD2CAEUL,
|
||||
0x9D15208FUL, 0x3FFD5FA9UL, 0x79B6E505UL, 0x3FFD91F6UL, 0x72BF2302UL, 0x3FFDC39AUL,
|
||||
0xF68C1570UL, 0x3FFDF49AUL, 0x2D4C23B8UL, 0x3FFE24FDUL, 0xFDC5EC73UL, 0x3FFE54C5UL,
|
||||
0x11B81DBBUL, 0x3FFE83FAUL, 0xD9DBAF25UL, 0x3FFEB29DUL, 0x9191D374UL, 0x3FFEE0B5UL,
|
||||
0x4245E4BFUL, 0x3FFF0E45UL, 0xC68A9DD3UL, 0x3FFF3B50UL, 0xCCF922DCUL, 0x3FFF67DBUL,
|
||||
0xDAD7A4A6UL, 0x3FFF93E9UL, 0x4E8CC9CBUL, 0x3FFFBF7EUL, 0x61E47CD3UL, 0x3FFFEA9CUL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _D_table[] =
|
||||
{
|
||||
4050900474, 1014427190, 1157977860, 1016444461, 1374568199, 1017271387,
|
||||
2809163288, 1016882676, 3742377377, 1013168191, 3101606597, 1017541672,
|
||||
65224358, 1017217597, 2691591250, 1017266643, 4020758549, 1017689313,
|
||||
1316310992, 1018030788, 1031537856, 1014090882, 3261395239, 1016413641,
|
||||
886424999, 1016313335, 3114776834, 1014195875, 1681120620, 1017825416,
|
||||
1329600273, 1016625740, 465474623, 1017097119, 4251633980, 1017169077,
|
||||
1986990133, 1017710645, 752958613, 1017159641, 2216216792, 1018020163,
|
||||
4282860129, 1015924861, 1557627859, 1016039538, 3889219754, 1018086237,
|
||||
3684996408, 1017353275, 723532103, 1017717141, 2951149676, 1012528470,
|
||||
831890937, 1017830553, 1031212645, 1017387331, 2741737450, 1017604974,
|
||||
2863311531, 1003776682, 4276736099, 1013153088, 4111778382, 1015673686,
|
||||
1728065769, 1016413986, 2708718031, 1018078833, 1069335005, 1015291224,
|
||||
700037144, 1016482032, 2904566452, 1017226861, 4074156649, 1017622651,
|
||||
25019565, 1015245366, 3601952608, 1015771755, 3267129373, 1017904664,
|
||||
503203103, 1014921629, 2122011730, 1018027866, 3927295461, 1014189456,
|
||||
2790625147, 1016024251, 1330460186, 1016940346, 4033568463, 1015538390,
|
||||
3695818227, 1017509621, 257573361, 1017208868, 3227697852, 1017337964,
|
||||
234118548, 1017169577, 4009025803, 1017278524, 1948343394, 1017749310,
|
||||
678398162, 1018144239, 3083864863, 1016669086, 2415453452, 1017890370,
|
||||
175467344, 1017330033, 3197359580, 1010339928, 2071276951, 1015941358,
|
||||
268372543, 1016737773, 938132959, 1017389108, 1816750559, 1017337448,
|
||||
4119203749, 1017152174, 2578653878, 1013108497, 2470331096, 1014678606,
|
||||
123855735, 1016553320, 1265650889, 1014782687, 3414398172, 1017182638,
|
||||
1040773369, 1016158401, 3483628886, 1016886550, 4140499405, 1016191425,
|
||||
3893477850, 1016964495, 3935319771, 1009634717, 2978982660, 1015027112,
|
||||
2452709923, 1017990229, 3190365712, 1015835149, 4237588139, 1015832925,
|
||||
2610678389, 1017962711, 2127316774, 1017405770, 824267502, 1017959463,
|
||||
2165924042, 1017912225, 2774007076, 1013257418, 4123916326, 1017582284,
|
||||
1976417958, 1016959909, 4092806412, 1017711279, 119251817, 1015363631,
|
||||
3475418768, 1017675415, 1972580503, 1015470684, 815541017, 1017517969,
|
||||
2429917451, 1017397776, 4062888482, 1016749897, 68284153, 1017925678,
|
||||
2207779246, 1016320298, 1183466520, 1017408657, 143326427, 1017060403
|
||||
0xF173D5FAUL, 0x3C76EE36UL, 0x45055704UL, 0x3C95B62DUL, 0x51EE3F07UL, 0x3CA2545BUL,
|
||||
0xA7706E18UL, 0x3C9C65F4UL, 0xDF1025A1UL, 0x3C63B83FUL, 0xB8DEC2C5UL, 0x3CA67428UL,
|
||||
0x03E33EA6UL, 0x3CA1823DUL, 0xA06E6C52UL, 0x3CA241D3UL, 0xEFA7E815UL, 0x3CA8B4E1UL,
|
||||
0x4E754FD0UL, 0x3CADEAC4UL, 0x3D7C04C0UL, 0x3C71CC82UL, 0xC264F127UL, 0x3C953DC9UL,
|
||||
0x34D5C5A7UL, 0x3C93B5F7UL, 0xB9A7B902UL, 0x3C7366A3UL, 0x6433DD6CUL, 0x3CAAC888UL,
|
||||
0x4F401711UL, 0x3C987A4CUL, 0x1BBE943FUL, 0x3C9FAB9FUL, 0xFD6AC93CUL, 0x3CA0C4B5UL,
|
||||
0x766F1035UL, 0x3CA90835UL, 0x2CE13C95UL, 0x3CA09FD9UL, 0x8418C8D8UL, 0x3CADC143UL,
|
||||
0xFF474261UL, 0x3C8DC87DUL, 0x5CD783D3UL, 0x3C8F8872UL, 0xE7D0C8AAUL, 0x3CAEC35DUL,
|
||||
0xDBA49538UL, 0x3CA3943BUL, 0x2B203947UL, 0x3CA92195UL, 0xAFE6F86CUL, 0x3C59F556UL,
|
||||
0x3195A5F9UL, 0x3CAADC99UL, 0x3D770E65UL, 0x3CA41943UL, 0xA36B97EAUL, 0x3CA76B6EUL,
|
||||
0xAAAAAAABUL, 0x3BD46AAAUL, 0xFEE9D063UL, 0x3C637D40UL, 0xF514C24EUL, 0x3C89F356UL,
|
||||
0x670030E9UL, 0x3C953F22UL, 0xA173C1CFUL, 0x3CAEA671UL, 0x3FBCC1DDUL, 0x3C841D58UL,
|
||||
0x29B9B818UL, 0x3C9648F0UL, 0xAD202AB4UL, 0x3CA1A66DUL, 0xF2D6B269UL, 0x3CA7B07BUL,
|
||||
0x017DC4ADUL, 0x3C836A36UL, 0xD6B16F60UL, 0x3C8B726BUL, 0xC2BC701DUL, 0x3CABFE18UL,
|
||||
0x1DFE451FUL, 0x3C7E799DUL, 0x7E7B5452UL, 0x3CADDF5AUL, 0xEA15C5E5UL, 0x3C734D90UL,
|
||||
0xA6558F7BUL, 0x3C8F4CBBUL, 0x4F4D361AUL, 0x3C9D473AUL, 0xF06B5ECFUL, 0x3C87E2D6UL,
|
||||
0xDC49B5F3UL, 0x3CA5F6F5UL, 0x0F5A41F1UL, 0x3CA16024UL, 0xC062C2BCUL, 0x3CA3586CUL,
|
||||
0x0DF45D94UL, 0x3CA0C6A9UL, 0xEEF4E10BUL, 0x3CA2703CUL, 0x74215C62UL, 0x3CA99F3EUL,
|
||||
0x286F88D2UL, 0x3CAFA5EFUL, 0xB7D00B1FUL, 0x3C99239EUL, 0x8FF8E50CUL, 0x3CABC642UL,
|
||||
0x0A756B50UL, 0x3CA33971UL, 0xBE93D5DCUL, 0x3C389058UL, 0x7B752D97UL, 0x3C8E08EEUL,
|
||||
0x0FFF0A3FUL, 0x3C9A2FEDUL, 0x37EAC5DFUL, 0x3CA42034UL, 0x6C4969DFUL, 0x3CA35668UL,
|
||||
0xF5860FA5UL, 0x3CA082AEUL, 0x99B322B6UL, 0x3C62CF11UL, 0x933E42D8UL, 0x3C7AC44EUL,
|
||||
0x0761E377UL, 0x3C975F68UL, 0x4B704CC9UL, 0x3C7C5ADFUL, 0xCB8394DCUL, 0x3CA0F9AEUL,
|
||||
0x3E08F0F9UL, 0x3C9158C1UL, 0xCFA3F556UL, 0x3C9C7516UL, 0xF6CB01CDUL, 0x3C91D9C1UL,
|
||||
0xE811C1DAUL, 0x3C9DA58FUL, 0xEA9036DBUL, 0x3C2DCD9DUL, 0xB18FAB04UL, 0x3C8015A8UL,
|
||||
0x92316223UL, 0x3CAD4C55UL, 0xBE291E10UL, 0x3C8C6A0DUL, 0xFC9476ABUL, 0x3C8C615DUL,
|
||||
0x9B9BCA75UL, 0x3CACE0D7UL, 0x7ECC4726UL, 0x3CA4614AUL, 0x312152EEUL, 0x3CACD427UL,
|
||||
0x811960CAUL, 0x3CAC1BA1UL, 0xA557FD24UL, 0x3C6514CAUL, 0xF5CDF826UL, 0x3CA712CCUL,
|
||||
0x75CDBEA6UL, 0x3C9D93A5UL, 0xF3F3450CUL, 0x3CA90AAFUL, 0x071BA369UL, 0x3C85382FUL,
|
||||
0xCF26AE90UL, 0x3CA87E97UL, 0x75933097UL, 0x3C86DA5CUL, 0x309C2B19UL, 0x3CA61791UL,
|
||||
0x90D5990BUL, 0x3CA44210UL, 0xF22AC222UL, 0x3C9A5F49UL, 0x0411EEF9UL, 0x3CAC502EUL,
|
||||
0x839809AEUL, 0x3C93D12AUL, 0x468A4418UL, 0x3CA46C91UL, 0x088AFCDBUL, 0x3C9F1C33UL
|
||||
};
|
||||
|
||||
#define __ _masm->
|
||||
|
||||
@@ -77,226 +77,226 @@
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _HALFMASK[] =
|
||||
{
|
||||
4160749568, 2147483647
|
||||
0xF8000000UL, 0x7FFFFFFFUL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _ONEMASK[] =
|
||||
{
|
||||
0, 1072693248
|
||||
0x00000000UL, 0x3FF00000UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _TWOMASK[] =
|
||||
{
|
||||
0, 1073741824
|
||||
0x00000000UL, 0x40000000UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(16) static const juint _MASK3[] =
|
||||
{
|
||||
0, 4294967280, 0, 4294967280
|
||||
0x00000000UL, 0xFFFFFFF0UL, 0x00000000UL, 0xFFFFFFF0UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(16) static const juint _RMASK[] =
|
||||
{
|
||||
4294705152, 4294967295, 4294705152, 4294967295
|
||||
0xFFFC0000UL, 0xFFFFFFFFUL, 0xFFFC0000UL, 0xFFFFFFFFUL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(16) static const juint _L2E[] =
|
||||
{
|
||||
1610612736, 1082594631, 4166901572, 1055174155
|
||||
0x60000000UL, 0x40871547UL, 0xF85DDF44UL, 0x3EE4AE0BUL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(16) static const juint _Shifter[] =
|
||||
{
|
||||
0, 1127743488, 0, 3275227136
|
||||
0x00000000UL, 0x43380000UL, 0x00000000UL, 0xC3380000UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(16) static const juint _cv[] =
|
||||
{
|
||||
3884607281, 3168131199, 3607404735, 3190582024, 1874480759,
|
||||
1032041131, 4286760334, 1053736893, 4277811695, 3211144770,
|
||||
0, 0
|
||||
0xE78A6731UL, 0xBCD5D87FUL, 0xD704A0BFUL, 0xBE2C6B08UL, 0x6FBA4E77UL,
|
||||
0x3D83B2ABUL, 0xFF82C58EUL, 0x3ECEBFBDUL, 0xFEFA39EFUL, 0xBF662E42UL,
|
||||
0x00000000UL, 0x00000000UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(4) static const juint _pv[] =
|
||||
{
|
||||
236289503, 1064135997, 463583772, 3215696314, 1441186365,
|
||||
3212977891, 286331153, 1069617425, 2284589306, 1066820852,
|
||||
1431655765, 3218429269
|
||||
0x0E157DDFUL, 0x3F6D6D3DUL, 0x1BA1BA1CUL, 0xBFABA1BAUL, 0x55E6C23DUL,
|
||||
0xBF8226E3UL, 0x11111111UL, 0x3FC11111UL, 0x882C10FAUL, 0x3F9664F4UL,
|
||||
0x55555555UL, 0xBFD55555UL
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED(16) static const juint _T2_neg_f[] =
|
||||
{
|
||||
0, 1072693248, 0, 0, 1797923801, 1072687577,
|
||||
1950547427, 1013229059, 730821105, 1072681922, 2523232743, 1012067188,
|
||||
915592468, 1072676282, 352947894, 3161024371, 2174652632, 1072670657,
|
||||
4087714590, 1014450259, 35929225, 1072665048, 2809788041, 3159436968,
|
||||
2912730644, 1072659453, 3490067722, 3163405074, 2038973688, 1072653874,
|
||||
892941374, 1016046459, 1533953344, 1072648310, 769171851, 1015665633,
|
||||
1222472308, 1072642761, 1054357470, 3161021018, 929806999, 1072637227,
|
||||
3205336643, 1015259557, 481706282, 1072631708, 1696079173, 3162710528,
|
||||
3999357479, 1072626203, 2258941616, 1015924724, 2719515920, 1072620714,
|
||||
2760332941, 1015137933, 764307441, 1072615240, 3021057420, 3163329523,
|
||||
2256325230, 1072609780, 580117746, 1015317295, 2728693978, 1072604335,
|
||||
396109971, 3163462691, 2009970496, 1072598905, 2159039665, 3162572948,
|
||||
4224142467, 1072593489, 3389820386, 1015207202, 610758006, 1072588089,
|
||||
1965209397, 3161866232, 3884662774, 1072582702, 2158611599, 1014210185,
|
||||
991358482, 1072577331, 838715019, 3163157668, 351641897, 1072571974,
|
||||
2172261526, 3163010599, 1796832535, 1072566631, 3176955716, 3160585513,
|
||||
863738719, 1072561303, 1326992220, 3162613197, 1679558232, 1072555989,
|
||||
2390342287, 3163333970, 4076975200, 1072550689, 2029000899, 1015208535,
|
||||
3594158869, 1072545404, 2456521700, 3163256561, 64696965, 1072540134,
|
||||
1768797490, 1015816960, 1912561781, 1072534877, 3147495102, 1015678253,
|
||||
382305176, 1072529635, 2347622376, 3162578625, 3898795731, 1072524406,
|
||||
1249994144, 1011869818, 3707479175, 1072519192, 3613079303, 1014164738,
|
||||
3939148246, 1072513992, 3210352148, 1015274323, 135105010, 1072508807,
|
||||
1906148728, 3163375739, 721996136, 1072503635, 563754734, 1015371318,
|
||||
1242007932, 1072498477, 1132034716, 3163339831, 1532734324, 1072493333,
|
||||
3094216535, 3163162857, 1432208378, 1072488203, 1401068914, 3162363963,
|
||||
778901109, 1072483087, 2248183955, 3161268751, 3706687593, 1072477984,
|
||||
3521726940, 1013253067, 1464976603, 1072472896, 3507292405, 3161977534,
|
||||
2483480501, 1072467821, 1216371780, 1013034172, 2307442995, 1072462760,
|
||||
3190117721, 3162404539, 777507147, 1072457713, 4282924205, 1015187533,
|
||||
2029714210, 1072452679, 613660079, 1015099143, 1610600570, 1072447659,
|
||||
3766732298, 1015760183, 3657065772, 1072442652, 399025623, 3162957078,
|
||||
3716502172, 1072437659, 2303740125, 1014042725, 1631695677, 1072432680,
|
||||
2717633076, 3162344026, 1540824585, 1072427714, 1064017011, 3163487690,
|
||||
3287523847, 1072422761, 1625971539, 3157009955, 2420883922, 1072417822,
|
||||
2049810052, 1014119888, 3080351519, 1072412896, 3379126788, 3157218001,
|
||||
815859274, 1072407984, 240396590, 3163487443, 4062661092, 1072403084,
|
||||
1422616006, 3163255318, 4076559943, 1072398198, 2119478331, 3160758351,
|
||||
703710506, 1072393326, 1384660846, 1015195891, 2380618042, 1072388466,
|
||||
3149557219, 3163320799, 364333489, 1072383620, 3923737744, 3161421373,
|
||||
3092190715, 1072378786, 814012168, 3159523422, 1822067026, 1072373966,
|
||||
1241994956, 1015340290, 697153126, 1072369159, 1283515429, 3163283189,
|
||||
3861050111, 1072364364, 254893773, 3162813180, 2572866477, 1072359583,
|
||||
878562433, 1015521741, 977020788, 1072354815, 3065100517, 1015541563,
|
||||
3218338682, 1072350059, 3404164304, 3162477108, 557149882, 1072345317,
|
||||
3672720709, 1014537265, 1434058175, 1072340587, 251133233, 1015085769,
|
||||
1405169241, 1072335870, 2998539689, 3162830951, 321958744, 1072331166,
|
||||
3401933767, 1015794558, 2331271250, 1072326474, 812057446, 1012207446,
|
||||
2990417245, 1072321795, 3683467745, 3163369326, 2152073944, 1072317129,
|
||||
1486860576, 3163203456, 3964284211, 1072312475, 2111583915, 1015427164,
|
||||
3985553595, 1072307834, 4002146062, 1015834136, 2069751141, 1072303206,
|
||||
1562170675, 3162724681, 2366108318, 1072298590, 2867985102, 3161762254,
|
||||
434316067, 1072293987, 2028358766, 1013458122, 424392917, 1072289396,
|
||||
2749202995, 3162838718, 2191782032, 1072284817, 2960257726, 1013742662,
|
||||
1297350157, 1072280251, 1308022040, 3163412558, 1892288442, 1072275697,
|
||||
2446255666, 3162600381, 3833209506, 1072271155, 2722920684, 1013754842,
|
||||
2682146384, 1072266626, 2082178513, 3163363419, 2591453363, 1072262109,
|
||||
2132396182, 3159074198, 3418903055, 1072257604, 2527457337, 3160820604,
|
||||
727685349, 1072253112, 2038246809, 3162358742, 2966275557, 1072248631,
|
||||
2176155324, 3159842759, 1403662306, 1072244163, 2788809599, 3161671007,
|
||||
194117574, 1072239707, 777528612, 3163412089, 3492293770, 1072235262,
|
||||
2248032210, 1015386826, 2568320822, 1072230830, 2732824428, 1014352915,
|
||||
1577608921, 1072226410, 1875489510, 3162968394, 380978316, 1072222002,
|
||||
854188970, 3160462686, 3134592888, 1072217605, 4232266862, 1015991134,
|
||||
1110089947, 1072213221, 1451641639, 1015474673, 2759350287, 1072208848,
|
||||
1148526634, 1015894933, 3649726105, 1072204487, 4085036346, 1015649474,
|
||||
3643909174, 1072200138, 3537586109, 1014354647, 2604962541, 1072195801,
|
||||
2614425274, 3163539192, 396319521, 1072191476, 4172420816, 3159074632,
|
||||
1176749997, 1072187162, 2738998779, 3162035844, 515457527, 1072182860,
|
||||
836709333, 1015651226, 2571947539, 1072178569, 3558159064, 3163376669,
|
||||
2916157145, 1072174290, 219487565, 1015309367, 1413356050, 1072170023,
|
||||
1651349291, 3162668166, 2224145553, 1072165767, 3482522030, 3161489169,
|
||||
919555682, 1072161523, 3121969534, 1012948226, 1660913392, 1072157290,
|
||||
4218599604, 1015135707, 19972402, 1072153069, 3507899862, 1016009292,
|
||||
158781403, 1072148859, 2221464712, 3163286453, 1944781191, 1072144660,
|
||||
3993278767, 3161724279, 950803702, 1072140473, 1655364926, 1015237032,
|
||||
1339972927, 1072136297, 167908909, 1015572152, 2980802057, 1072132132,
|
||||
378619896, 1015773303, 1447192521, 1072127979, 1462857171, 3162514521,
|
||||
903334909, 1072123837, 1636462108, 1015039997, 1218806132, 1072119706,
|
||||
1818613052, 3162548441, 2263535754, 1072115586, 752233586, 3162639008,
|
||||
3907805044, 1072111477, 2257091225, 3161550407, 1727278727, 1072107380,
|
||||
3562710623, 1011471940, 4182873220, 1072103293, 629542646, 3161996303,
|
||||
2555984613, 1072099218, 2652555442, 3162552692, 1013258799, 1072095154,
|
||||
1748797611, 3160129082, 3721688645, 1072091100, 3069276937, 1015839401,
|
||||
1963711167, 1072087058, 1744767757, 3160574294, 4201977662, 1072083026,
|
||||
748330254, 1013594357, 1719614413, 1072079006, 330458198, 3163282740,
|
||||
2979960120, 1072074996, 2599109725, 1014498493, 3561793907, 1072070997,
|
||||
1157054053, 1011890350, 3339203574, 1072067009, 1483497780, 3162408754,
|
||||
2186617381, 1072063032, 2270764084, 3163272713, 4273770423, 1072059065,
|
||||
3383180809, 3163218901, 885834528, 1072055110, 1973258547, 3162261564,
|
||||
488188413, 1072051165, 3199821029, 1015564048, 2956612997, 1072047230,
|
||||
2118169751, 3162735553, 3872257780, 1072043306, 1253592103, 1015958334,
|
||||
3111574537, 1072039393, 2606161479, 3162759746, 551349105, 1072035491,
|
||||
3821916050, 3162106589, 363667784, 1072031599, 813753950, 1015785209,
|
||||
2425981843, 1072027717, 2830390851, 3163346599, 2321106615, 1072023846,
|
||||
2171176610, 1009535771, 4222122499, 1072019985, 1277378074, 3163256737,
|
||||
3712504873, 1072016135, 88491949, 1015427660, 671025100, 1072012296,
|
||||
3832014351, 3163022030, 3566716925, 1072008466, 1536826856, 1014142433,
|
||||
3689071823, 1072004647, 2321004996, 3162552716, 917841882, 1072000839,
|
||||
18715565, 1015659308, 3723038930, 1071997040, 378465264, 3162569582,
|
||||
3395129871, 1071993252, 4025345435, 3162335388, 4109806887, 1071989474,
|
||||
422403966, 1014469229, 1453150082, 1071985707, 498154669, 3161488062,
|
||||
3896463087, 1071981949, 1139797873, 3161233805, 2731501122, 1071978202,
|
||||
1774031855, 3162470021, 2135241198, 1071974465, 1236747871, 1013589147,
|
||||
1990012071, 1071970738, 3529070563, 3162813193, 2178460671, 1071967021,
|
||||
777878098, 3162842493, 2583551245, 1071963314, 3161094195, 1015606491,
|
||||
3088564500, 1071959617, 1762311517, 1015045673, 3577096743, 1071955930,
|
||||
2951496418, 1013793687, 3933059031, 1071952253, 2133366768, 3161531832,
|
||||
4040676318, 1071948586, 4090609238, 1015663458, 3784486610, 1071944929,
|
||||
1581883040, 3161698953, 3049340112, 1071941282, 3062915824, 1013170595,
|
||||
1720398391, 1071937645, 3980678963, 3163300080, 3978100823, 1071934017,
|
||||
3513027190, 1015845963, 1118294578, 1071930400, 2197495694, 3159909401,
|
||||
1617004845, 1071926792, 82804944, 1010342778, 1065662932, 1071923194,
|
||||
2533670915, 1014530238, 3645941911, 1071919605, 3814685081, 3161573341,
|
||||
654919306, 1071916027, 3232961757, 3163047469, 569847338, 1071912458,
|
||||
472945272, 3159290729, 3278348324, 1071908898, 3069497416, 1014750712,
|
||||
78413852, 1071905349, 4183226867, 3163017251, 3743175029, 1071901808,
|
||||
2072812490, 3162175075, 1276261410, 1071898278, 300981948, 1014684169,
|
||||
1156440435, 1071894757, 2351451249, 1013967056, 3272845541, 1071891245,
|
||||
928852419, 3163488248, 3219942644, 1071887743, 3798990616, 1015368806,
|
||||
887463927, 1071884251, 3596744163, 3160794166, 460407023, 1071880768,
|
||||
4237175092, 3163138469, 1829099622, 1071877294, 1016661181, 3163461005,
|
||||
589198666, 1071873830, 2664346172, 3163157962, 926591435, 1071870375,
|
||||
3208833762, 3162913514, 2732492859, 1071866929, 2691479646, 3162255684,
|
||||
1603444721, 1071863493, 1548633640, 3162201326, 1726216749, 1071860066,
|
||||
2466808228, 3161676405, 2992903935, 1071856648, 2218154406, 1015228193,
|
||||
1000925746, 1071853240, 1018491672, 3163309544, 4232894513, 1071849840,
|
||||
2383938684, 1014668519, 3991843581, 1071846450, 4092853457, 1014585763,
|
||||
171030293, 1071843070, 3526460132, 1014428778, 1253935211, 1071839698,
|
||||
1395382931, 3159702613, 2839424854, 1071836335, 1171596163, 1013041679,
|
||||
526652809, 1071832982, 4223459736, 1015879375, 2799960843, 1071829637,
|
||||
1423655381, 1015022151, 964107055, 1071826302, 2800439588, 3162833221,
|
||||
3504003472, 1071822975, 3594001060, 3157330652, 1724976915, 1071819658,
|
||||
420909223, 3163117379, 4112506593, 1071816349, 2947355221, 1014371048,
|
||||
1972484976, 1071813050, 675290301, 3161640050, 3790955393, 1071809759,
|
||||
2352942462, 3163180090, 874372905, 1071806478, 100263788, 1015940732,
|
||||
1709341917, 1071803205, 2571168217, 1014152499, 1897844341, 1071799941,
|
||||
1254300460, 1015275938, 1337108031, 1071796686, 3203724452, 1014677845,
|
||||
4219606026, 1071793439, 2434574742, 1014681548, 1853186616, 1071790202,
|
||||
3066496371, 1015656574, 2725843665, 1071786973, 1433917087, 1014838523,
|
||||
2440944790, 1071783753, 2492769774, 1014147454, 897099801, 1071780542,
|
||||
754756297, 1015241005, 2288159958, 1071777339, 2169144469, 1014876021,
|
||||
2218315341, 1071774145, 2694295388, 3163288868, 586995997, 1071770960,
|
||||
41662348, 3162627992, 1588871207, 1071767783, 143439582, 3162963416,
|
||||
828946858, 1071764615, 10642492, 1015939438, 2502433899, 1071761455,
|
||||
2148595913, 1015023991, 2214878420, 1071758304, 892270087, 3163116422,
|
||||
4162030108, 1071755161, 2763428480, 1015529349, 3949972341, 1071752027,
|
||||
2068408548, 1014913868, 1480023343, 1071748902, 2247196168, 1015327453,
|
||||
948735466, 1071745785, 3516338028, 3162574883, 2257959872, 1071742676,
|
||||
3802946148, 1012964927, 1014845819, 1071739576, 3117910646, 3161559105,
|
||||
1416741826, 1071736484, 2196380210, 1011413563, 3366293073, 1071733400,
|
||||
3119426314, 1014120554, 2471440686, 1071730325, 968836267, 3162214888,
|
||||
2930322912, 1071727258, 2599499422, 3162714047, 351405227, 1071724200,
|
||||
3125337328, 3159822479, 3228316108, 1071721149, 3010241991, 3158422804,
|
||||
2875075254, 1071718107, 4144233330, 3163333716, 3490863953, 1071715073,
|
||||
960797498, 3162948880, 685187902, 1071712048, 378731989, 1014843115,
|
||||
2952712987, 1071709030, 3293494651, 3160120301, 1608493509, 1071706021,
|
||||
3159622171, 3162807737, 852742562, 1071703020, 667253586, 1009793559,
|
||||
590962156, 1071700027, 3829346666, 3163275597, 728909815, 1071697042,
|
||||
383930225, 1015029468, 1172597893, 1071694065, 114433263, 1015347593,
|
||||
1828292879, 1071691096, 1255956747, 1015588398, 2602514713, 1071688135,
|
||||
2268929336, 1014354284, 3402036099, 1071685182, 405889334, 1015105656,
|
||||
4133881824, 1071682237, 2148155345, 3162931299, 410360776, 1071679301,
|
||||
1269990655, 1011975870, 728934454, 1071676372, 1413842688, 1014178612,
|
||||
702412510, 1071673451, 3803266087, 3162280415, 238821257, 1071670538,
|
||||
1469694871, 3162884987, 3541402996, 1071667632, 2759177317, 1014854626,
|
||||
1928746161, 1071664735, 983617676, 1014285177, 3899555717, 1071661845,
|
||||
427280750, 3162546972, 772914124, 1071658964, 4004372762, 1012230161,
|
||||
1048019041, 1071656090, 1398474845, 3160510595, 339411585, 1071653224,
|
||||
264588982, 3161636657, 2851812149, 1071650365, 2595802551, 1015767337,
|
||||
4200250559, 1071647514, 2808127345, 3161781938
|
||||
0x00000000UL, 0x3FF00000UL, 0x00000000UL, 0x00000000UL, 0x6B2A23D9UL, 0x3FEFE9D9UL,
|
||||
0x7442FDE3UL, 0x3C64A603UL, 0x2B8F71F1UL, 0x3FEFD3C2UL, 0x966579E7UL, 0x3C52EB74UL,
|
||||
0x3692D514UL, 0x3FEFBDBAUL, 0x15098EB6UL, 0xBC696773UL, 0x819E90D8UL, 0x3FEFA7C1UL,
|
||||
0xF3A5931EUL, 0x3C774853UL, 0x02243C89UL, 0x3FEF91D8UL, 0xA779F689UL, 0xBC512EA8UL,
|
||||
0xAD9CBE14UL, 0x3FEF7BFDUL, 0xD006350AUL, 0xBC8DBB12UL, 0x798844F8UL, 0x3FEF6632UL,
|
||||
0x3539343EUL, 0x3C8FA37BUL, 0x5B6E4540UL, 0x3FEF5076UL, 0x2DD8A18BUL, 0x3C89D3E1UL,
|
||||
0x48DD7274UL, 0x3FEF3AC9UL, 0x3ED837DEUL, 0xBC695A5AUL, 0x376BBA97UL, 0x3FEF252BUL,
|
||||
0xBF0D8E43UL, 0x3C83A1A5UL, 0x1CB6412AUL, 0x3FEF0F9CUL, 0x65181D45UL, 0xBC832200UL,
|
||||
0xEE615A27UL, 0x3FEEFA1BUL, 0x86A4B6B0UL, 0x3C8DC7F4UL, 0xA2188510UL, 0x3FEEE4AAUL,
|
||||
0xA487568DUL, 0x3C81C68DUL, 0x2D8E67F1UL, 0x3FEECF48UL, 0xB411AD8CUL, 0xBC8C93F3UL,
|
||||
0x867CCA6EUL, 0x3FEEB9F4UL, 0x2293E4F2UL, 0x3C84832FUL, 0xA2A490DAUL, 0x3FEEA4AFUL,
|
||||
0x179C2893UL, 0xBC8E9C23UL, 0x77CDB740UL, 0x3FEE8F79UL, 0x80B054B1UL, 0xBC810894UL,
|
||||
0xFBC74C83UL, 0x3FEE7A51UL, 0xCA0C8DE2UL, 0x3C82D522UL, 0x24676D76UL, 0x3FEE6539UL,
|
||||
0x7522B735UL, 0xBC763FF8UL, 0xE78B3FF6UL, 0x3FEE502EUL, 0x80A9CC8FUL, 0x3C739E89UL,
|
||||
0x3B16EE12UL, 0x3FEE3B33UL, 0x31FDC68BUL, 0xBC89F4A4UL, 0x14F5A129UL, 0x3FEE2646UL,
|
||||
0x817A1496UL, 0xBC87B627UL, 0x6B197D17UL, 0x3FEE1167UL, 0xBD5C7F44UL, 0xBC62B529UL,
|
||||
0x337B9B5FUL, 0x3FEDFC97UL, 0x4F184B5CUL, 0xBC81A5CDUL, 0x641C0658UL, 0x3FEDE7D5UL,
|
||||
0x8E79BA8FUL, 0xBC8CA552UL, 0xF301B460UL, 0x3FEDD321UL, 0x78F018C3UL, 0x3C82DA57UL,
|
||||
0xD63A8315UL, 0x3FEDBE7CUL, 0x926B8BE4UL, 0xBC8B76F1UL, 0x03DB3285UL, 0x3FEDA9E6UL,
|
||||
0x696DB532UL, 0x3C8C2300UL, 0x71FF6075UL, 0x3FED955DUL, 0xBB9AF6BEUL, 0x3C8A052DUL,
|
||||
0x16C98398UL, 0x3FED80E3UL, 0x8BEDDFE8UL, 0xBC811EC1UL, 0xE862E6D3UL, 0x3FED6C76UL,
|
||||
0x4A8165A0UL, 0x3C4FE87AUL, 0xDCFBA487UL, 0x3FED5818UL, 0xD75B3707UL, 0x3C72ED02UL,
|
||||
0xEACAA1D6UL, 0x3FED43C8UL, 0xBF5A1614UL, 0x3C83DB53UL, 0x080D89F2UL, 0x3FED2F87UL,
|
||||
0x719D8578UL, 0xBC8D487BUL, 0x2B08C968UL, 0x3FED1B53UL, 0x219A36EEUL, 0x3C855636UL,
|
||||
0x4A07897CUL, 0x3FED072DUL, 0x43797A9CUL, 0xBC8CBC37UL, 0x5B5BAB74UL, 0x3FECF315UL,
|
||||
0xB86DFF57UL, 0xBC8A08E9UL, 0x555DC3FAUL, 0x3FECDF0BUL, 0x53829D72UL, 0xBC7DD83BUL,
|
||||
0x2E6D1675UL, 0x3FECCB0FUL, 0x86009093UL, 0xBC6D220FUL, 0xDCEF9069UL, 0x3FECB720UL,
|
||||
0xD1E949DCUL, 0x3C6503CBUL, 0x5751C4DBUL, 0x3FECA340UL, 0xD10D08F5UL, 0xBC77F2BEUL,
|
||||
0x9406E7B5UL, 0x3FEC8F6DUL, 0x48805C44UL, 0x3C61ACBCUL, 0x8988C933UL, 0x3FEC7BA8UL,
|
||||
0xBE255559UL, 0xBC7E76BBUL, 0x2E57D14BUL, 0x3FEC67F1UL, 0xFF483CADUL, 0x3C82884DUL,
|
||||
0x78FAFB22UL, 0x3FEC5447UL, 0x2493B5AFUL, 0x3C812F07UL, 0x5FFFD07AUL, 0x3FEC40ABUL,
|
||||
0xE083C60AUL, 0x3C8B4537UL, 0xD9FA652CUL, 0x3FEC2D1CUL, 0x17C8A5D7UL, 0xBC86E516UL,
|
||||
0xDD85529CUL, 0x3FEC199BUL, 0x895048DDUL, 0x3C711065UL, 0x6141B33DUL, 0x3FEC0628UL,
|
||||
0xA1FBCA34UL, 0xBC7D8A5AUL, 0x5BD71E09UL, 0x3FEBF2C2UL, 0x3F6B9C73UL, 0xBC8EFDCAUL,
|
||||
0xC3F3A207UL, 0x3FEBDF69UL, 0x60EA5B53UL, 0xBC2C2623UL, 0x904BC1D2UL, 0x3FEBCC1EUL,
|
||||
0x7A2D9E84UL, 0x3C723DD0UL, 0xB79A6F1FUL, 0x3FEBB8E0UL, 0xC9696204UL, 0xBC2F52D1UL,
|
||||
0x30A1064AUL, 0x3FEBA5B0UL, 0x0E54292EUL, 0xBC8EFCD3UL, 0xF22749E4UL, 0x3FEB928CUL,
|
||||
0x54CB65C6UL, 0xBC8B7216UL, 0xF2FB5E47UL, 0x3FEB7F76UL, 0x7E54AC3BUL, 0xBC65584FUL,
|
||||
0x29F1C52AUL, 0x3FEB6C6EUL, 0x52883F6EUL, 0x3C82A8F3UL, 0x8DE5593AUL, 0x3FEB5972UL,
|
||||
0xBBBA6DE3UL, 0xBC8C71DFUL, 0x15B749B1UL, 0x3FEB4684UL, 0xE9DF7C90UL, 0xBC6F763DUL,
|
||||
0xB84F15FBUL, 0x3FEB33A2UL, 0x3084D708UL, 0xBC52805EUL, 0x6C9A8952UL, 0x3FEB20CEUL,
|
||||
0x4A0756CCUL, 0x3C84DD02UL, 0x298DB666UL, 0x3FEB0E07UL, 0x4C80E425UL, 0xBC8BDEF5UL,
|
||||
0xE622F2FFUL, 0x3FEAFB4CUL, 0x0F315ECDUL, 0xBC84B2FCUL, 0x995AD3ADUL, 0x3FEAE89FUL,
|
||||
0x345DCC81UL, 0x3C87A1CDUL, 0x3A3C2774UL, 0x3FEAD5FFUL, 0xB6B1B8E5UL, 0x3C87EF3BUL,
|
||||
0xBFD3F37AUL, 0x3FEAC36BUL, 0xCAE76CD0UL, 0xBC7F9234UL, 0x21356EBAUL, 0x3FEAB0E5UL,
|
||||
0xDAE94545UL, 0x3C789C31UL, 0x5579FDBFUL, 0x3FEA9E6BUL, 0x0EF7FD31UL, 0x3C80FAC9UL,
|
||||
0x53C12E59UL, 0x3FEA8BFEUL, 0xB2BA15A9UL, 0xBC84F867UL, 0x1330B358UL, 0x3FEA799EUL,
|
||||
0xCAC563C7UL, 0x3C8BCB7EUL, 0x8AF46052UL, 0x3FEA674AUL, 0x30670366UL, 0x3C550F56UL,
|
||||
0xB23E255DUL, 0x3FEA5503UL, 0xDB8D41E1UL, 0xBC8D2F6EUL, 0x80460AD8UL, 0x3FEA42C9UL,
|
||||
0x589FB120UL, 0xBC8AA780UL, 0xEC4A2D33UL, 0x3FEA309BUL, 0x7DDC36ABUL, 0x3C86305CUL,
|
||||
0xED8EB8BBUL, 0x3FEA1E7AUL, 0xEE8BE70EUL, 0x3C8C6618UL, 0x7B5DE565UL, 0x3FEA0C66UL,
|
||||
0x5D1CD533UL, 0xBC835949UL, 0x8D07F29EUL, 0x3FE9FA5EUL, 0xAAF1FACEUL, 0xBC74A9CEUL,
|
||||
0x19E32323UL, 0x3FE9E863UL, 0x78E64C6EUL, 0x3C6824CAUL, 0x194BB8D5UL, 0x3FE9D674UL,
|
||||
0xA3DD8233UL, 0xBC8516BEUL, 0x82A3F090UL, 0x3FE9C491UL, 0xB071F2BEUL, 0x3C6C7C46UL,
|
||||
0x4D53FE0DUL, 0x3FE9B2BBUL, 0x4DF6D518UL, 0xBC8DD84EUL, 0x70CA07BAUL, 0x3FE9A0F1UL,
|
||||
0x91CEE632UL, 0xBC8173BDUL, 0xE47A22A2UL, 0x3FE98F33UL, 0xA24C78ECUL, 0x3C6CABDAUL,
|
||||
0x9FDE4E50UL, 0x3FE97D82UL, 0x7C1B85D1UL, 0xBC8D185BUL, 0x9A7670B3UL, 0x3FE96BDDUL,
|
||||
0x7F19C896UL, 0xBC4BA596UL, 0xCBC8520FUL, 0x3FE95A44UL, 0x96A5F039UL, 0xBC664B7CUL,
|
||||
0x2B5F98E5UL, 0x3FE948B8UL, 0x797D2D99UL, 0xBC7DC3D6UL, 0xB0CDC5E5UL, 0x3FE93737UL,
|
||||
0x81B57EBCUL, 0xBC575FC7UL, 0x53AA2FE2UL, 0x3FE925C3UL, 0xA639DB7FUL, 0xBC73455FUL,
|
||||
0x0B91FFC6UL, 0x3FE9145BUL, 0x2E582524UL, 0xBC8DD679UL, 0xD0282C8AUL, 0x3FE902FEUL,
|
||||
0x85FE3FD2UL, 0x3C8592CAUL, 0x99157736UL, 0x3FE8F1AEUL, 0xA2E3976CUL, 0x3C75CC13UL,
|
||||
0x5E0866D9UL, 0x3FE8E06AUL, 0x6FC9B2E6UL, 0xBC87114AUL, 0x16B5448CUL, 0x3FE8CF32UL,
|
||||
0x32E9E3AAUL, 0xBC60D55EUL, 0xBAD61778UL, 0x3FE8BE05UL, 0xFC43446EUL, 0x3C8ECB5EUL,
|
||||
0x422AA0DBUL, 0x3FE8ACE5UL, 0x56864B27UL, 0x3C86E9F1UL, 0xA478580FUL, 0x3FE89BD0UL,
|
||||
0x4475202AUL, 0x3C8D5395UL, 0xD98A6699UL, 0x3FE88AC7UL, 0xF37CB53AUL, 0x3C8994C2UL,
|
||||
0xD931A436UL, 0x3FE879CAUL, 0xD2DB47BDUL, 0x3C75D2D7UL, 0x9B4492EDUL, 0x3FE868D9UL,
|
||||
0x9BD4F6BAUL, 0xBC8FC6F8UL, 0x179F5B21UL, 0x3FE857F4UL, 0xF8B216D0UL, 0xBC4BA748UL,
|
||||
0x4623C7ADUL, 0x3FE8471AUL, 0xA341CDFBUL, 0xBC78D684UL, 0x1EB941F7UL, 0x3FE8364CUL,
|
||||
0x31DF2BD5UL, 0x3C899B9AUL, 0x994CCE13UL, 0x3FE82589UL, 0xD41532D8UL, 0xBC8D4C1DUL,
|
||||
0xADD106D9UL, 0x3FE814D2UL, 0x0D151D4DUL, 0x3C846437UL, 0x543E1A12UL, 0x3FE80427UL,
|
||||
0x626D972BUL, 0xBC827C86UL, 0x8491C491UL, 0x3FE7F387UL, 0xCF9311AEUL, 0xBC707F11UL,
|
||||
0x36CF4E62UL, 0x3FE7E2F3UL, 0xBA15797EUL, 0x3C605D02UL, 0x62FF86F0UL, 0x3FE7D26AUL,
|
||||
0xFB72B8B4UL, 0x3C81BDDBUL, 0x0130C132UL, 0x3FE7C1EDUL, 0xD1164DD6UL, 0x3C8F124CUL,
|
||||
0x0976CFDBUL, 0x3FE7B17BUL, 0x8468DC88UL, 0xBC8BEBB5UL, 0x73EB0187UL, 0x3FE7A114UL,
|
||||
0xEE04992FUL, 0xBC741577UL, 0x38AC1CF6UL, 0x3FE790B9UL, 0x62AADD3EUL, 0x3C8349A8UL,
|
||||
0x4FDE5D3FUL, 0x3FE78069UL, 0x0A02162DUL, 0x3C8866B8UL, 0xB1AB6E09UL, 0x3FE77024UL,
|
||||
0x169147F8UL, 0x3C8B7877UL, 0x564267C9UL, 0x3FE75FEBUL, 0x57316DD3UL, 0xBC802459UL,
|
||||
0x35D7CBFDUL, 0x3FE74FBDUL, 0x618A6E1CUL, 0x3C8047FDUL, 0x48A58174UL, 0x3FE73F9AUL,
|
||||
0x6C65D53CUL, 0xBC80A8D9UL, 0x86EAD08AUL, 0x3FE72F82UL, 0x2CD62C72UL, 0xBC820AA0UL,
|
||||
0xE8EC5F74UL, 0x3FE71F75UL, 0x86887A99UL, 0xBC716E47UL, 0x66F42E87UL, 0x3FE70F74UL,
|
||||
0xD45AA65FUL, 0x3C49D644UL, 0xF9519484UL, 0x3FE6FF7DUL, 0x25860EF6UL, 0xBC783C0FUL,
|
||||
0x98593AE5UL, 0x3FE6EF92UL, 0x9E1AC8B2UL, 0xBC80B974UL, 0x3C651A2FUL, 0x3FE6DFB2UL,
|
||||
0x683C88ABUL, 0xBC5BBE3AUL, 0xDDD47645UL, 0x3FE6CFDCUL, 0xB6F17309UL, 0x3C8C7AA9UL,
|
||||
0x750BDABFUL, 0x3FE6C012UL, 0x67FF0B0DUL, 0xBC628956UL, 0xFA75173EUL, 0x3FE6B052UL,
|
||||
0x2C9A9D0EUL, 0x3C6A38F5UL, 0x667F3BCDUL, 0x3FE6A09EUL, 0x13B26456UL, 0xBC8BDD34UL,
|
||||
0xB19E9538UL, 0x3FE690F4UL, 0x9AEB445DUL, 0x3C7804BDUL, 0xD44CA973UL, 0x3FE68155UL,
|
||||
0x44F73E65UL, 0x3C5038AEUL, 0xC70833F6UL, 0x3FE671C1UL, 0x586C6134UL, 0xBC7E8732UL,
|
||||
0x82552225UL, 0x3FE66238UL, 0x87591C34UL, 0xBC8BB609UL, 0xFEBC8FB7UL, 0x3FE652B9UL,
|
||||
0xC9A73E09UL, 0xBC8AE3D5UL, 0x34CCC320UL, 0x3FE64346UL, 0x759D8933UL, 0xBC7C483CUL,
|
||||
0x1D1929FDUL, 0x3FE633DDUL, 0xBEB964E5UL, 0x3C884710UL, 0xB03A5585UL, 0x3FE6247EUL,
|
||||
0x7E40B497UL, 0xBC8383C1UL, 0xE6CDF6F4UL, 0x3FE6152AUL, 0x4AB84C27UL, 0x3C8E4B3EUL,
|
||||
0xB976DC09UL, 0x3FE605E1UL, 0x9B56DE47UL, 0xBC83E242UL, 0x20DCEB71UL, 0x3FE5F6A3UL,
|
||||
0xE3CDCF92UL, 0xBC79EADDUL, 0x15AD2148UL, 0x3FE5E76FUL, 0x3080E65EUL, 0x3C8BA6F9UL,
|
||||
0x90998B93UL, 0x3FE5D845UL, 0xA8B45643UL, 0xBC8CD6A7UL, 0x8A5946B7UL, 0x3FE5C926UL,
|
||||
0x816986A2UL, 0x3C2C4B1BUL, 0xFBA87A03UL, 0x3FE5BA11UL, 0x4C233E1AUL, 0xBC8B77A1UL,
|
||||
0xDD485429UL, 0x3FE5AB07UL, 0x054647ADUL, 0x3C86324CUL, 0x27FF07CCUL, 0x3FE59C08UL,
|
||||
0xE467E60FUL, 0xBC87E2CEUL, 0xD497C7FDUL, 0x3FE58D12UL, 0x5B9A1DE8UL, 0x3C7295E1UL,
|
||||
0xDBE2C4CFUL, 0x3FE57E27UL, 0x8A57B9C4UL, 0xBC80B98CUL, 0x36B527DAUL, 0x3FE56F47UL,
|
||||
0x011D93ADUL, 0x3C89BB2CUL, 0xDDE910D2UL, 0x3FE56070UL, 0x168EEBF0UL, 0xBC80FB6EUL,
|
||||
0xCA5D920FUL, 0x3FE551A4UL, 0xEFEDE59BUL, 0xBC7D689CUL, 0xF4F6AD27UL, 0x3FE542E2UL,
|
||||
0x192D5F7EUL, 0x3C77926DUL, 0x569D4F82UL, 0x3FE5342BUL, 0x1DB13CADUL, 0xBC707ABEUL,
|
||||
0xE83F4EEFUL, 0x3FE5257DUL, 0x43EFEF71UL, 0xBC6C998DUL, 0xA2CF6642UL, 0x3FE516DAUL,
|
||||
0x69BD93EFUL, 0xBC7F7685UL, 0x7F4531EEUL, 0x3FE50841UL, 0x49B7465FUL, 0x3C6A249BUL,
|
||||
0x769D2CA7UL, 0x3FE4F9B2UL, 0xD25957E3UL, 0xBC84B309UL, 0x81D8ABFFUL, 0x3FE4EB2DUL,
|
||||
0x2E5D7A52UL, 0xBC85257DUL, 0x99FDDD0DUL, 0x3FE4DCB2UL, 0xBC6A7833UL, 0x3C88ECDBUL,
|
||||
0xB817C114UL, 0x3FE4CE41UL, 0x690ABD5DUL, 0x3C805E29UL, 0xD5362A27UL, 0x3FE4BFDAUL,
|
||||
0xAFEC42E2UL, 0x3C6D4397UL, 0xEA6DB7D7UL, 0x3FE4B17DUL, 0x7F2897F0UL, 0xBC7125B8UL,
|
||||
0xF0D7D3DEUL, 0x3FE4A32AUL, 0xF3D1BE56UL, 0x3C89CB62UL, 0xE192AED2UL, 0x3FE494E1UL,
|
||||
0x5E499EA0UL, 0xBC73B289UL, 0xB5C13CD0UL, 0x3FE486A2UL, 0xB69062F0UL, 0x3C63C1A3UL,
|
||||
0x668B3237UL, 0x3FE4786DUL, 0xED445733UL, 0xBC8C20F0UL, 0xED1D0057UL, 0x3FE46A41UL,
|
||||
0xD1648A76UL, 0x3C8C944BUL, 0x42A7D232UL, 0x3FE45C20UL, 0x82FB1F8EUL, 0xBC586419UL,
|
||||
0x6061892DUL, 0x3FE44E08UL, 0x04EF80D0UL, 0x3C389B7AUL, 0x3F84B9D4UL, 0x3FE43FFAUL,
|
||||
0x9704C003UL, 0x3C7880BEUL, 0xD950A897UL, 0x3FE431F5UL, 0xE35F7999UL, 0xBC71C7DDUL,
|
||||
0x2709468AUL, 0x3FE423FBUL, 0xC0B314DDUL, 0xBC88462DUL, 0x21F72E2AUL, 0x3FE4160AUL,
|
||||
0x1C309278UL, 0xBC4EF369UL, 0xC367A024UL, 0x3FE40822UL, 0xB6F4D048UL, 0x3C7BDDF8UL,
|
||||
0x04AC801CUL, 0x3FE3FA45UL, 0xF956F9F3UL, 0xBC87D023UL, 0xDF1C5175UL, 0x3FE3EC70UL,
|
||||
0x7B8C9BCAUL, 0xBC7AF663UL, 0x4C123422UL, 0x3FE3DEA6UL, 0x11F09EBCUL, 0x3C7ADA09UL,
|
||||
0x44EDE173UL, 0x3FE3D0E5UL, 0x8C284C71UL, 0x3C6FE8D0UL, 0xC313A8E5UL, 0x3FE3C32DUL,
|
||||
0x375D29C3UL, 0xBC8EFFF8UL, 0xBFEC6CF4UL, 0x3FE3B57FUL, 0xE26FFF18UL, 0x3C854C66UL,
|
||||
0x34E59FF7UL, 0x3FE3A7DBUL, 0xD661F5E3UL, 0xBC65E436UL, 0x1B7140EFUL, 0x3FE39A40UL,
|
||||
0xFC8E2934UL, 0xBC89A9A5UL, 0x6D05D866UL, 0x3FE38CAEUL, 0x3C9904BDUL, 0xBC8E958DUL,
|
||||
0x231E754AUL, 0x3FE37F26UL, 0x9ECEB23CUL, 0xBC89F5CAUL, 0x373AA9CBUL, 0x3FE371A7UL,
|
||||
0xBF42EAE2UL, 0xBC863AEAUL, 0xA2DE883BUL, 0x3FE36431UL, 0xA06CB85EUL, 0xBC7C3144UL,
|
||||
0x5F929FF1UL, 0x3FE356C5UL, 0x5C4E4628UL, 0xBC7B5CEEUL, 0x66E3FA2DUL, 0x3FE34962UL,
|
||||
0x930881A4UL, 0xBC735A75UL, 0xB26416FFUL, 0x3FE33C08UL, 0x843659A6UL, 0x3C832721UL,
|
||||
0x3BA8EA32UL, 0x3FE32EB8UL, 0x3CB4F318UL, 0xBC8C45E8UL, 0xFC4CD831UL, 0x3FE32170UL,
|
||||
0x8E18047CUL, 0x3C7A9CE7UL, 0xEDEEB2FDUL, 0x3FE31432UL, 0xF3F3FCD1UL, 0x3C7959A3UL,
|
||||
0x0A31B715UL, 0x3FE306FEUL, 0xD23182E4UL, 0x3C76F46AUL, 0x4ABD886BUL, 0x3FE2F9D2UL,
|
||||
0x532BDA93UL, 0xBC553C55UL, 0xA93E2F56UL, 0x3FE2ECAFUL, 0x45D52383UL, 0x3C61CA0FUL,
|
||||
0x1F641589UL, 0x3FE2DF96UL, 0xFBBCE198UL, 0x3C8D16CFUL, 0xA6E4030BUL, 0x3FE2D285UL,
|
||||
0x54DB41D5UL, 0x3C800247UL, 0x39771B2FUL, 0x3FE2C57EUL, 0xA6EB5124UL, 0xBC850145UL,
|
||||
0xD0DAD990UL, 0x3FE2B87FUL, 0xD6381AA4UL, 0xBC310ADCUL, 0x66D10F13UL, 0x3FE2AB8AUL,
|
||||
0x191690A7UL, 0xBC895743UL, 0xF51FDEE1UL, 0x3FE29E9DUL, 0xAFAD1255UL, 0x3C7612E8UL,
|
||||
0x7591BB70UL, 0x3FE291BAUL, 0x28401CBDUL, 0xBC72CC72UL, 0xE1F56381UL, 0x3FE284DFUL,
|
||||
0x8C3F0D7EUL, 0xBC8A4C3AUL, 0x341DDF29UL, 0x3FE2780EUL, 0x05F9E76CUL, 0x3C8E067CUL,
|
||||
0x65E27CDDUL, 0x3FE26B45UL, 0x9940E9D9UL, 0x3C72BD33UL, 0x711ECE75UL, 0x3FE25E85UL,
|
||||
0x4AC31B2CUL, 0x3C83E1A2UL, 0x4FB2A63FUL, 0x3FE251CEUL, 0xBEF4F4A4UL, 0x3C7AC155UL,
|
||||
0xFB82140AUL, 0x3FE2451FUL, 0x911CA996UL, 0x3C7ACFCCUL, 0x6E756238UL, 0x3FE2387AUL,
|
||||
0xB6C70573UL, 0x3C89B07EUL, 0xA27912D1UL, 0x3FE22BDDUL, 0x5577D69FUL, 0x3C7D34FBUL,
|
||||
0x917DDC96UL, 0x3FE21F49UL, 0x9494A5EEUL, 0x3C72A97EUL, 0x3578A819UL, 0x3FE212BEUL,
|
||||
0x2CFCAAC9UL, 0x3C83592DUL, 0x88628CD6UL, 0x3FE2063BUL, 0x814A8495UL, 0x3C7DC775UL,
|
||||
0x8438CE4DUL, 0x3FE1F9C1UL, 0xA097AF5CUL, 0xBC8BF524UL, 0x22FCD91DUL, 0x3FE1ED50UL,
|
||||
0x027BB78CUL, 0xBC81DF98UL, 0x5EB44027UL, 0x3FE1E0E7UL, 0x088CB6DEUL, 0xBC86FDD8UL,
|
||||
0x3168B9AAUL, 0x3FE1D487UL, 0x00A2643CUL, 0x3C8E016EUL, 0x95281C6BUL, 0x3FE1C82FUL,
|
||||
0x8010F8C9UL, 0x3C800977UL, 0x84045CD4UL, 0x3FE1BBE0UL, 0x352EF607UL, 0xBC895386UL,
|
||||
0xF8138A1CUL, 0x3FE1AF99UL, 0xA4B69280UL, 0x3C87BF85UL, 0xEB6FCB75UL, 0x3FE1A35BUL,
|
||||
0x7B4968E4UL, 0x3C7E5B4CUL, 0x58375D2FUL, 0x3FE19726UL, 0x85F17E08UL, 0x3C84AADDUL,
|
||||
0x388C8DEAUL, 0x3FE18AF9UL, 0xD1970F6CUL, 0xBC811023UL, 0x8695BBC0UL, 0x3FE17ED4UL,
|
||||
0xE2AC5A64UL, 0x3C609E3FUL, 0x3C7D517BUL, 0x3FE172B8UL, 0xB9D78A76UL, 0xBC719041UL,
|
||||
0x5471C3C2UL, 0x3FE166A4UL, 0x82EA1A32UL, 0x3C48F23BUL, 0xC8A58E51UL, 0x3FE15A98UL,
|
||||
0xB9EEAB0AUL, 0x3C72406AUL, 0x934F312EUL, 0x3FE14E95UL, 0x39BF44ABUL, 0xBC7B91E8UL,
|
||||
0xAEA92DE0UL, 0x3FE1429AUL, 0x9AF1369EUL, 0xBC832FBFUL, 0x14F204ABUL, 0x3FE136A8UL,
|
||||
0xBA48DCF0UL, 0xBC57108FUL, 0xC06C31CCUL, 0x3FE12ABDUL, 0xB36CA5C7UL, 0xBC41B514UL,
|
||||
0xAB5E2AB6UL, 0x3FE11EDBUL, 0xF703FB72UL, 0xBC8CA454UL, 0xD0125B51UL, 0x3FE11301UL,
|
||||
0x39449B3AUL, 0xBC86C510UL, 0x28D7233EUL, 0x3FE10730UL, 0x1692FDD5UL, 0x3C7D46EBUL,
|
||||
0xAFFED31BUL, 0x3FE0FB66UL, 0xC44EBD7BUL, 0xBC5B9BEDUL, 0x5FDFA9C5UL, 0x3FE0EFA5UL,
|
||||
0xBC54021BUL, 0xBC849DB9UL, 0x32D3D1A2UL, 0x3FE0E3ECUL, 0x27C57B52UL, 0x3C303A17UL,
|
||||
0x23395DECUL, 0x3FE0D83BUL, 0xE43F316AUL, 0xBC8BC14DUL, 0x2B7247F7UL, 0x3FE0CC92UL,
|
||||
0x16E24F71UL, 0x3C801EDCUL, 0x45E46C85UL, 0x3FE0C0F1UL, 0x06D21CEFUL, 0x3C84F989UL,
|
||||
0x6CF9890FUL, 0x3FE0B558UL, 0x4ADC610BUL, 0x3C88A62EUL, 0x9B1F3919UL, 0x3FE0A9C7UL,
|
||||
0x873D1D38UL, 0x3C75D16CUL, 0xCAC6F383UL, 0x3FE09E3EUL, 0x18316136UL, 0x3C814878UL,
|
||||
0xF66607E0UL, 0x3FE092BDUL, 0x800A3FD1UL, 0xBC868063UL, 0x18759BC8UL, 0x3FE08745UL,
|
||||
0x4BB284FFUL, 0x3C5186BEUL, 0x2B72A836UL, 0x3FE07BD4UL, 0x54458700UL, 0x3C732334UL,
|
||||
0x29DDF6DEUL, 0x3FE0706BUL, 0xE2B13C27UL, 0xBC7C91DFUL, 0x0E3C1F89UL, 0x3FE0650AUL,
|
||||
0x5799C397UL, 0xBC85CB7BUL, 0xD3158574UL, 0x3FE059B0UL, 0xA475B465UL, 0x3C7D73E2UL,
|
||||
0x72F654B1UL, 0x3FE04E5FUL, 0x3AA0D08CUL, 0x3C74C379UL, 0xE86E7F85UL, 0x3FE04315UL,
|
||||
0x1977C96EUL, 0xBC80A31CUL, 0x2E11BBCCUL, 0x3FE037D4UL, 0xEEADE11AUL, 0x3C556811UL,
|
||||
0x3E778061UL, 0x3FE02C9AUL, 0x535B085DUL, 0xBC619083UL, 0x143B0281UL, 0x3FE02168UL,
|
||||
0x0FC54EB6UL, 0xBC72BF31UL, 0xA9FB3335UL, 0x3FE0163DUL, 0x9AB8CDB7UL, 0x3C8B6129UL,
|
||||
0xFA5ABCBFUL, 0x3FE00B1AUL, 0xA7609F71UL, 0xBC74F6B2UL
|
||||
};
|
||||
|
||||
#define __ _masm->
|
||||
|
||||
@@ -62,7 +62,7 @@ address VM_Version::_cpuinfo_segv_addr_apx = nullptr;
|
||||
address VM_Version::_cpuinfo_cont_addr_apx = nullptr;
|
||||
|
||||
static BufferBlob* stub_blob;
|
||||
static const int stub_size = 2000;
|
||||
static const int stub_size = 2550;
|
||||
|
||||
int VM_Version::VM_Features::_features_bitmap_size = sizeof(VM_Version::VM_Features::_features_bitmap) / BytesPerLong;
|
||||
|
||||
@@ -73,10 +73,12 @@ extern "C" {
|
||||
typedef void (*get_cpu_info_stub_t)(void*);
|
||||
typedef void (*detect_virt_stub_t)(uint32_t, uint32_t*);
|
||||
typedef void (*clear_apx_test_state_t)(void);
|
||||
typedef void (*getCPUIDBrandString_stub_t)(void*);
|
||||
}
|
||||
static get_cpu_info_stub_t get_cpu_info_stub = nullptr;
|
||||
static detect_virt_stub_t detect_virt_stub = nullptr;
|
||||
static clear_apx_test_state_t clear_apx_test_state_stub = nullptr;
|
||||
static getCPUIDBrandString_stub_t getCPUIDBrandString_stub = nullptr;
|
||||
|
||||
bool VM_Version::supports_clflush() {
|
||||
// clflush should always be available on x86_64
|
||||
@@ -2131,6 +2133,8 @@ void VM_Version::initialize() {
|
||||
g.generate_detect_virt());
|
||||
clear_apx_test_state_stub = CAST_TO_FN_PTR(clear_apx_test_state_t,
|
||||
g.clear_apx_test_state());
|
||||
getCPUIDBrandString_stub = CAST_TO_FN_PTR(getCPUIDBrandString_stub_t,
|
||||
g.generate_getCPUIDBrandString());
|
||||
get_processor_features();
|
||||
|
||||
Assembler::precompute_instructions();
|
||||
@@ -2187,15 +2191,6 @@ typedef enum {
|
||||
TM_FLAG = 0x20000000
|
||||
} FeatureEdxFlag;
|
||||
|
||||
static BufferBlob* cpuid_brand_string_stub_blob;
|
||||
static const int cpuid_brand_string_stub_size = 550;
|
||||
|
||||
extern "C" {
|
||||
typedef void (*getCPUIDBrandString_stub_t)(void*);
|
||||
}
|
||||
|
||||
static getCPUIDBrandString_stub_t getCPUIDBrandString_stub = nullptr;
|
||||
|
||||
// VM_Version statics
|
||||
enum {
|
||||
ExtendedFamilyIdLength_INTEL = 16,
|
||||
@@ -2488,19 +2483,6 @@ const char* const _feature_extended_ecx_id[] = {
|
||||
""
|
||||
};
|
||||
|
||||
void VM_Version::initialize_tsc(void) {
|
||||
ResourceMark rm;
|
||||
|
||||
cpuid_brand_string_stub_blob = BufferBlob::create("getCPUIDBrandString_stub", cpuid_brand_string_stub_size);
|
||||
if (cpuid_brand_string_stub_blob == nullptr) {
|
||||
vm_exit_during_initialization("Unable to allocate getCPUIDBrandString_stub");
|
||||
}
|
||||
CodeBuffer c(cpuid_brand_string_stub_blob);
|
||||
VM_Version_StubGenerator g(&c);
|
||||
getCPUIDBrandString_stub = CAST_TO_FN_PTR(getCPUIDBrandString_stub_t,
|
||||
g.generate_getCPUIDBrandString());
|
||||
}
|
||||
|
||||
const char* VM_Version::cpu_model_description(void) {
|
||||
uint32_t cpu_family = extended_cpu_family();
|
||||
uint32_t cpu_model = extended_cpu_model();
|
||||
@@ -2589,7 +2571,12 @@ void VM_Version::resolve_cpu_information_details(void) {
|
||||
_no_of_threads = os::processor_count();
|
||||
|
||||
// find out number of threads per cpu package
|
||||
int threads_per_package = threads_per_core() * cores_per_cpu();
|
||||
int threads_per_package = _cpuid_info.tpl_cpuidB1_ebx.bits.logical_cpus;
|
||||
if (threads_per_package == 0) {
|
||||
// Fallback code to avoid div by zero in subsequent code.
|
||||
// CPUID 0Bh (ECX = 1) might return 0 on older AMD processor (EPYC 7763 at least)
|
||||
threads_per_package = threads_per_core() * cores_per_cpu();
|
||||
}
|
||||
|
||||
// use amount of threads visible to the process in order to guess number of sockets
|
||||
_no_of_sockets = _no_of_threads / threads_per_package;
|
||||
@@ -2743,6 +2730,10 @@ size_t VM_Version::cpu_write_support_string(char* const buf, size_t buf_len) {
|
||||
WRITE_TO_BUF("Invariant TSC");
|
||||
}
|
||||
|
||||
if (supports_hybrid()) {
|
||||
WRITE_TO_BUF("Hybrid Architecture");
|
||||
}
|
||||
|
||||
return written;
|
||||
}
|
||||
|
||||
|
||||
@@ -1093,7 +1093,6 @@ public:
|
||||
|
||||
static bool supports_tscinv_ext(void);
|
||||
|
||||
static void initialize_tsc();
|
||||
static void initialize_cpu_information(void);
|
||||
};
|
||||
|
||||
|
||||
@@ -7664,8 +7664,11 @@ instruct vcastFtoD_reg(vec dst, vec src) %{
|
||||
|
||||
|
||||
instruct castFtoX_reg_avx(vec dst, vec src, vec xtmp1, vec xtmp2, vec xtmp3, vec xtmp4, rFlagsReg cr) %{
|
||||
predicate(!VM_Version::supports_avx512vl() && Matcher::vector_length_in_bytes(n->in(1)) < 64 &&
|
||||
type2aelembytes(Matcher::vector_element_basic_type(n)) <= 4);
|
||||
predicate(!VM_Version::supports_avx10_2() &&
|
||||
!VM_Version::supports_avx512vl() &&
|
||||
Matcher::vector_length_in_bytes(n->in(1)) < 64 &&
|
||||
type2aelembytes(Matcher::vector_element_basic_type(n)) <= 4 &&
|
||||
is_integral_type(Matcher::vector_element_basic_type(n)));
|
||||
match(Set dst (VectorCastF2X src));
|
||||
effect(TEMP dst, TEMP xtmp1, TEMP xtmp2, TEMP xtmp3, TEMP xtmp4, KILL cr);
|
||||
format %{ "vector_cast_f2x $dst,$src\t! using $xtmp1, $xtmp2, $xtmp3 and $xtmp4 as TEMP" %}
|
||||
@@ -7687,7 +7690,8 @@ instruct castFtoX_reg_avx(vec dst, vec src, vec xtmp1, vec xtmp2, vec xtmp3, vec
|
||||
%}
|
||||
|
||||
instruct castFtoX_reg_evex(vec dst, vec src, vec xtmp1, vec xtmp2, kReg ktmp1, kReg ktmp2, rFlagsReg cr) %{
|
||||
predicate((VM_Version::supports_avx512vl() || Matcher::vector_length_in_bytes(n->in(1)) == 64) &&
|
||||
predicate(!VM_Version::supports_avx10_2() &&
|
||||
(VM_Version::supports_avx512vl() || Matcher::vector_length_in_bytes(n->in(1)) == 64) &&
|
||||
is_integral_type(Matcher::vector_element_basic_type(n)));
|
||||
match(Set dst (VectorCastF2X src));
|
||||
effect(TEMP dst, TEMP xtmp1, TEMP xtmp2, TEMP ktmp1, TEMP ktmp2, KILL cr);
|
||||
@@ -7709,6 +7713,33 @@ instruct castFtoX_reg_evex(vec dst, vec src, vec xtmp1, vec xtmp2, kReg ktmp1, k
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct castFtoX_reg_avx10(vec dst, vec src) %{
|
||||
predicate(VM_Version::supports_avx10_2() &&
|
||||
is_integral_type(Matcher::vector_element_basic_type(n)));
|
||||
match(Set dst (VectorCastF2X src));
|
||||
format %{ "vector_cast_f2x_avx10 $dst, $src\t!" %}
|
||||
ins_encode %{
|
||||
BasicType to_elem_bt = Matcher::vector_element_basic_type(this);
|
||||
int vlen_enc = (to_elem_bt == T_LONG) ? vector_length_encoding(this) : vector_length_encoding(this, $src);
|
||||
__ vector_castF2X_avx10(to_elem_bt, $dst$$XMMRegister, $src$$XMMRegister, vlen_enc);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct castFtoX_mem_avx10(vec dst, memory src) %{
|
||||
predicate(VM_Version::supports_avx10_2() &&
|
||||
is_integral_type(Matcher::vector_element_basic_type(n)));
|
||||
match(Set dst (VectorCastF2X (LoadVector src)));
|
||||
format %{ "vector_cast_f2x_avx10 $dst, $src\t!" %}
|
||||
ins_encode %{
|
||||
int vlen = Matcher::vector_length(this);
|
||||
BasicType to_elem_bt = Matcher::vector_element_basic_type(this);
|
||||
int vlen_enc = (to_elem_bt == T_LONG) ? vector_length_encoding(this) : vector_length_encoding(vlen * sizeof(jfloat));
|
||||
__ vector_castF2X_avx10(to_elem_bt, $dst$$XMMRegister, $src$$Address, vlen_enc);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct vcastDtoF_reg(vec dst, vec src) %{
|
||||
predicate(Matcher::vector_element_basic_type(n) == T_FLOAT);
|
||||
match(Set dst (VectorCastD2X src));
|
||||
@@ -7721,7 +7752,9 @@ instruct vcastDtoF_reg(vec dst, vec src) %{
|
||||
%}
|
||||
|
||||
instruct castDtoX_reg_avx(vec dst, vec src, vec xtmp1, vec xtmp2, vec xtmp3, vec xtmp4, vec xtmp5, rFlagsReg cr) %{
|
||||
predicate(!VM_Version::supports_avx512vl() && Matcher::vector_length_in_bytes(n->in(1)) < 64 &&
|
||||
predicate(!VM_Version::supports_avx10_2() &&
|
||||
!VM_Version::supports_avx512vl() &&
|
||||
Matcher::vector_length_in_bytes(n->in(1)) < 64 &&
|
||||
is_integral_type(Matcher::vector_element_basic_type(n)));
|
||||
match(Set dst (VectorCastD2X src));
|
||||
effect(TEMP dst, TEMP xtmp1, TEMP xtmp2, TEMP xtmp3, TEMP xtmp4, TEMP xtmp5, KILL cr);
|
||||
@@ -7737,7 +7770,8 @@ instruct castDtoX_reg_avx(vec dst, vec src, vec xtmp1, vec xtmp2, vec xtmp3, vec
|
||||
%}
|
||||
|
||||
instruct castDtoX_reg_evex(vec dst, vec src, vec xtmp1, vec xtmp2, kReg ktmp1, kReg ktmp2, rFlagsReg cr) %{
|
||||
predicate((VM_Version::supports_avx512vl() || Matcher::vector_length_in_bytes(n->in(1)) == 64) &&
|
||||
predicate(!VM_Version::supports_avx10_2() &&
|
||||
(VM_Version::supports_avx512vl() || Matcher::vector_length_in_bytes(n->in(1)) == 64) &&
|
||||
is_integral_type(Matcher::vector_element_basic_type(n)));
|
||||
match(Set dst (VectorCastD2X src));
|
||||
effect(TEMP dst, TEMP xtmp1, TEMP xtmp2, TEMP ktmp1, TEMP ktmp2, KILL cr);
|
||||
@@ -7753,6 +7787,33 @@ instruct castDtoX_reg_evex(vec dst, vec src, vec xtmp1, vec xtmp2, kReg ktmp1, k
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct castDtoX_reg_avx10(vec dst, vec src) %{
|
||||
predicate(VM_Version::supports_avx10_2() &&
|
||||
is_integral_type(Matcher::vector_element_basic_type(n)));
|
||||
match(Set dst (VectorCastD2X src));
|
||||
format %{ "vector_cast_d2x_avx10 $dst, $src\t!" %}
|
||||
ins_encode %{
|
||||
int vlen_enc = vector_length_encoding(this, $src);
|
||||
BasicType to_elem_bt = Matcher::vector_element_basic_type(this);
|
||||
__ vector_castD2X_avx10(to_elem_bt, $dst$$XMMRegister, $src$$XMMRegister, vlen_enc);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct castDtoX_mem_avx10(vec dst, memory src) %{
|
||||
predicate(VM_Version::supports_avx10_2() &&
|
||||
is_integral_type(Matcher::vector_element_basic_type(n)));
|
||||
match(Set dst (VectorCastD2X (LoadVector src)));
|
||||
format %{ "vector_cast_d2x_avx10 $dst, $src\t!" %}
|
||||
ins_encode %{
|
||||
int vlen = Matcher::vector_length(this);
|
||||
int vlen_enc = vector_length_encoding(vlen * sizeof(jdouble));
|
||||
BasicType to_elem_bt = Matcher::vector_element_basic_type(this);
|
||||
__ vector_castD2X_avx10(to_elem_bt, $dst$$XMMRegister, $src$$Address, vlen_enc);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct vucast(vec dst, vec src) %{
|
||||
match(Set dst (VectorUCastB2X src));
|
||||
match(Set dst (VectorUCastS2X src));
|
||||
|
||||
@@ -1697,11 +1697,6 @@ RegMask Matcher::modL_proj_mask() {
|
||||
return LONG_RDX_REG_mask();
|
||||
}
|
||||
|
||||
// Register for saving SP into on method handle invokes. Not used on x86_64.
|
||||
const RegMask Matcher::method_handle_invoke_SP_save_mask() {
|
||||
return NO_REG_mask();
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
//----------ENCODING BLOCK-----------------------------------------------------
|
||||
@@ -11712,6 +11707,7 @@ instruct convD2F_reg_mem(regF dst, memory src)
|
||||
// XXX do mem variants
|
||||
instruct convF2I_reg_reg(rRegI dst, regF src, rFlagsReg cr)
|
||||
%{
|
||||
predicate(!VM_Version::supports_avx10_2());
|
||||
match(Set dst (ConvF2I src));
|
||||
effect(KILL cr);
|
||||
format %{ "convert_f2i $dst, $src" %}
|
||||
@@ -11721,8 +11717,31 @@ instruct convF2I_reg_reg(rRegI dst, regF src, rFlagsReg cr)
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct convF2I_reg_reg_avx10(rRegI dst, regF src)
|
||||
%{
|
||||
predicate(VM_Version::supports_avx10_2());
|
||||
match(Set dst (ConvF2I src));
|
||||
format %{ "evcvttss2sisl $dst, $src" %}
|
||||
ins_encode %{
|
||||
__ evcvttss2sisl($dst$$Register, $src$$XMMRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct convF2I_reg_mem_avx10(rRegI dst, memory src)
|
||||
%{
|
||||
predicate(VM_Version::supports_avx10_2());
|
||||
match(Set dst (ConvF2I (LoadF src)));
|
||||
format %{ "evcvttss2sisl $dst, $src" %}
|
||||
ins_encode %{
|
||||
__ evcvttss2sisl($dst$$Register, $src$$Address);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct convF2L_reg_reg(rRegL dst, regF src, rFlagsReg cr)
|
||||
%{
|
||||
predicate(!VM_Version::supports_avx10_2());
|
||||
match(Set dst (ConvF2L src));
|
||||
effect(KILL cr);
|
||||
format %{ "convert_f2l $dst, $src"%}
|
||||
@@ -11732,8 +11751,31 @@ instruct convF2L_reg_reg(rRegL dst, regF src, rFlagsReg cr)
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct convF2L_reg_reg_avx10(rRegL dst, regF src)
|
||||
%{
|
||||
predicate(VM_Version::supports_avx10_2());
|
||||
match(Set dst (ConvF2L src));
|
||||
format %{ "evcvttss2sisq $dst, $src" %}
|
||||
ins_encode %{
|
||||
__ evcvttss2sisq($dst$$Register, $src$$XMMRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct convF2L_reg_mem_avx10(rRegL dst, memory src)
|
||||
%{
|
||||
predicate(VM_Version::supports_avx10_2());
|
||||
match(Set dst (ConvF2L (LoadF src)));
|
||||
format %{ "evcvttss2sisq $dst, $src" %}
|
||||
ins_encode %{
|
||||
__ evcvttss2sisq($dst$$Register, $src$$Address);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct convD2I_reg_reg(rRegI dst, regD src, rFlagsReg cr)
|
||||
%{
|
||||
predicate(!VM_Version::supports_avx10_2());
|
||||
match(Set dst (ConvD2I src));
|
||||
effect(KILL cr);
|
||||
format %{ "convert_d2i $dst, $src"%}
|
||||
@@ -11743,8 +11785,31 @@ instruct convD2I_reg_reg(rRegI dst, regD src, rFlagsReg cr)
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct convD2I_reg_reg_avx10(rRegI dst, regD src)
|
||||
%{
|
||||
predicate(VM_Version::supports_avx10_2());
|
||||
match(Set dst (ConvD2I src));
|
||||
format %{ "evcvttsd2sisl $dst, $src" %}
|
||||
ins_encode %{
|
||||
__ evcvttsd2sisl($dst$$Register, $src$$XMMRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct convD2I_reg_mem_avx10(rRegI dst, memory src)
|
||||
%{
|
||||
predicate(VM_Version::supports_avx10_2());
|
||||
match(Set dst (ConvD2I (LoadD src)));
|
||||
format %{ "evcvttsd2sisl $dst, $src" %}
|
||||
ins_encode %{
|
||||
__ evcvttsd2sisl($dst$$Register, $src$$Address);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct convD2L_reg_reg(rRegL dst, regD src, rFlagsReg cr)
|
||||
%{
|
||||
predicate(!VM_Version::supports_avx10_2());
|
||||
match(Set dst (ConvD2L src));
|
||||
effect(KILL cr);
|
||||
format %{ "convert_d2l $dst, $src"%}
|
||||
@@ -11754,6 +11819,28 @@ instruct convD2L_reg_reg(rRegL dst, regD src, rFlagsReg cr)
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct convD2L_reg_reg_avx10(rRegL dst, regD src)
|
||||
%{
|
||||
predicate(VM_Version::supports_avx10_2());
|
||||
match(Set dst (ConvD2L src));
|
||||
format %{ "evcvttsd2sisq $dst, $src" %}
|
||||
ins_encode %{
|
||||
__ evcvttsd2sisq($dst$$Register, $src$$XMMRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct convD2L_reg_mem_avx10(rRegL dst, memory src)
|
||||
%{
|
||||
predicate(VM_Version::supports_avx10_2());
|
||||
match(Set dst (ConvD2L (LoadD src)));
|
||||
format %{ "evcvttsd2sisq $dst, $src" %}
|
||||
ins_encode %{
|
||||
__ evcvttsd2sisq($dst$$Register, $src$$Address);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct round_double_reg(rRegL dst, regD src, rRegL rtmp, rcx_RegL rcx, rFlagsReg cr)
|
||||
%{
|
||||
match(Set dst (RoundD src));
|
||||
|
||||
@@ -169,7 +169,7 @@ static void vmembk_print_on(outputStream* os);
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// global variables (for a description see os_aix.hpp)
|
||||
|
||||
size_t os::Aix::_physical_memory = 0;
|
||||
physical_memory_size_type os::Aix::_physical_memory = 0;
|
||||
|
||||
pthread_t os::Aix::_main_thread = ((pthread_t)0);
|
||||
|
||||
@@ -254,43 +254,43 @@ static bool is_close_to_brk(address a) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool os::free_memory(size_t& value) {
|
||||
bool os::free_memory(physical_memory_size_type& value) {
|
||||
return Aix::available_memory(value);
|
||||
}
|
||||
|
||||
bool os::available_memory(size_t& value) {
|
||||
bool os::available_memory(physical_memory_size_type& value) {
|
||||
return Aix::available_memory(value);
|
||||
}
|
||||
|
||||
bool os::Aix::available_memory(size_t& value) {
|
||||
bool os::Aix::available_memory(physical_memory_size_type& value) {
|
||||
os::Aix::meminfo_t mi;
|
||||
if (os::Aix::get_meminfo(&mi)) {
|
||||
value = static_cast<size_t>(mi.real_free);
|
||||
value = static_cast<physical_memory_size_type>(mi.real_free);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool os::total_swap_space(size_t& value) {
|
||||
bool os::total_swap_space(physical_memory_size_type& value) {
|
||||
perfstat_memory_total_t memory_info;
|
||||
if (libperfstat::perfstat_memory_total(nullptr, &memory_info, sizeof(perfstat_memory_total_t), 1) == -1) {
|
||||
return false;
|
||||
}
|
||||
value = static_cast<size_t>(memory_info.pgsp_total * 4 * K);
|
||||
value = static_cast<physical_memory_size_type>(memory_info.pgsp_total * 4 * K);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool os::free_swap_space(size_t& value) {
|
||||
bool os::free_swap_space(physical_memory_size_type& value) {
|
||||
perfstat_memory_total_t memory_info;
|
||||
if (libperfstat::perfstat_memory_total(nullptr, &memory_info, sizeof(perfstat_memory_total_t), 1) == -1) {
|
||||
return false;
|
||||
}
|
||||
value = static_cast<size_t>(memory_info.pgsp_free * 4 * K);
|
||||
value = static_cast<physical_memory_size_type>(memory_info.pgsp_free * 4 * K);
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t os::physical_memory() {
|
||||
physical_memory_size_type os::physical_memory() {
|
||||
return Aix::physical_memory();
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ void os::Aix::initialize_system_info() {
|
||||
if (!os::Aix::get_meminfo(&mi)) {
|
||||
assert(false, "os::Aix::get_meminfo failed.");
|
||||
}
|
||||
_physical_memory = static_cast<size_t>(mi.real_total);
|
||||
_physical_memory = static_cast<physical_memory_size_type>(mi.real_total);
|
||||
}
|
||||
|
||||
// Helper function for tracing page sizes.
|
||||
@@ -2192,7 +2192,7 @@ jint os::init_2(void) {
|
||||
os::Posix::init_2();
|
||||
|
||||
trcVerbose("processor count: %d", os::_processor_count);
|
||||
trcVerbose("physical memory: %zu", Aix::_physical_memory);
|
||||
trcVerbose("physical memory: " PHYS_MEM_TYPE_FORMAT, Aix::_physical_memory);
|
||||
|
||||
// Initially build up the loaded dll map.
|
||||
LoadedLibraries::reload();
|
||||
|
||||
@@ -35,7 +35,7 @@ class os::Aix {
|
||||
|
||||
private:
|
||||
|
||||
static size_t _physical_memory;
|
||||
static physical_memory_size_type _physical_memory;
|
||||
static pthread_t _main_thread;
|
||||
|
||||
// 0 = uninitialized, otherwise 16 bit number:
|
||||
@@ -54,9 +54,9 @@ class os::Aix {
|
||||
// 1 - EXTSHM=ON
|
||||
static int _extshm;
|
||||
|
||||
static bool available_memory(size_t& value);
|
||||
static bool free_memory(size_t& value);
|
||||
static size_t physical_memory() { return _physical_memory; }
|
||||
static bool available_memory(physical_memory_size_type& value);
|
||||
static bool free_memory(physical_memory_size_type& value);
|
||||
static physical_memory_size_type physical_memory() { return _physical_memory; }
|
||||
static void initialize_system_info();
|
||||
|
||||
// OS recognitions (AIX OS level) call this before calling Aix::os_version().
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// global variables
|
||||
size_t os::Bsd::_physical_memory = 0;
|
||||
physical_memory_size_type os::Bsd::_physical_memory = 0;
|
||||
|
||||
#ifdef __APPLE__
|
||||
mach_timebase_info_data_t os::Bsd::_timebase_info = {0, 0};
|
||||
@@ -133,19 +133,19 @@ static volatile int processor_id_next = 0;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// utility functions
|
||||
|
||||
bool os::available_memory(size_t& value) {
|
||||
bool os::available_memory(physical_memory_size_type& value) {
|
||||
return Bsd::available_memory(value);
|
||||
}
|
||||
|
||||
bool os::free_memory(size_t& value) {
|
||||
bool os::free_memory(physical_memory_size_type& value) {
|
||||
return Bsd::available_memory(value);
|
||||
}
|
||||
|
||||
// Available here means free. Note that this number is of no much use. As an estimate
|
||||
// for future memory pressure it is far too conservative, since MacOS will use a lot
|
||||
// of unused memory for caches, and return it willingly in case of needs.
|
||||
bool os::Bsd::available_memory(size_t& value) {
|
||||
uint64_t available = static_cast<uint64_t>(physical_memory() >> 2);
|
||||
bool os::Bsd::available_memory(physical_memory_size_type& value) {
|
||||
physical_memory_size_type available = physical_memory() >> 2;
|
||||
#ifdef __APPLE__
|
||||
mach_msg_type_number_t count = HOST_VM_INFO64_COUNT;
|
||||
vm_statistics64_data_t vmstat;
|
||||
@@ -160,7 +160,7 @@ bool os::Bsd::available_memory(size_t& value) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
value = static_cast<size_t>(available);
|
||||
value = available;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -180,35 +180,35 @@ void os::Bsd::print_uptime_info(outputStream* st) {
|
||||
}
|
||||
}
|
||||
|
||||
bool os::total_swap_space(size_t& value) {
|
||||
bool os::total_swap_space(physical_memory_size_type& value) {
|
||||
#if defined(__APPLE__)
|
||||
struct xsw_usage vmusage;
|
||||
size_t size = sizeof(vmusage);
|
||||
if (sysctlbyname("vm.swapusage", &vmusage, &size, nullptr, 0) != 0) {
|
||||
return false;
|
||||
}
|
||||
value = static_cast<size_t>(vmusage.xsu_total);
|
||||
value = static_cast<physical_memory_size_type>(vmusage.xsu_total);
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool os::free_swap_space(size_t& value) {
|
||||
bool os::free_swap_space(physical_memory_size_type& value) {
|
||||
#if defined(__APPLE__)
|
||||
struct xsw_usage vmusage;
|
||||
size_t size = sizeof(vmusage);
|
||||
if (sysctlbyname("vm.swapusage", &vmusage, &size, nullptr, 0) != 0) {
|
||||
return false;
|
||||
}
|
||||
value = static_cast<size_t>(vmusage.xsu_avail);
|
||||
value = static_cast<physical_memory_size_type>(vmusage.xsu_avail);
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
size_t os::physical_memory() {
|
||||
physical_memory_size_type os::physical_memory() {
|
||||
return Bsd::physical_memory();
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ void os::Bsd::initialize_system_info() {
|
||||
len = sizeof(mem_val);
|
||||
if (sysctl(mib, 2, &mem_val, &len, nullptr, 0) != -1) {
|
||||
assert(len == sizeof(mem_val), "unexpected data size");
|
||||
_physical_memory = static_cast<size_t>(mem_val);
|
||||
_physical_memory = static_cast<physical_memory_size_type>(mem_val);
|
||||
} else {
|
||||
_physical_memory = 256 * 1024 * 1024; // fallback (XXXBSD?)
|
||||
}
|
||||
@@ -297,7 +297,7 @@ void os::Bsd::initialize_system_info() {
|
||||
// datasize rlimit restricts us anyway.
|
||||
struct rlimit limits;
|
||||
getrlimit(RLIMIT_DATA, &limits);
|
||||
_physical_memory = MIN2(_physical_memory, static_cast<size_t>(limits.rlim_cur));
|
||||
_physical_memory = MIN2(_physical_memory, static_cast<physical_memory_size_type>(limits.rlim_cur));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1469,12 +1469,12 @@ void os::print_memory_info(outputStream* st) {
|
||||
|
||||
st->print("Memory:");
|
||||
st->print(" %zuk page", os::vm_page_size()>>10);
|
||||
size_t phys_mem = os::physical_memory();
|
||||
st->print(", physical %zuk",
|
||||
physical_memory_size_type phys_mem = os::physical_memory();
|
||||
st->print(", physical " PHYS_MEM_TYPE_FORMAT "k",
|
||||
phys_mem >> 10);
|
||||
size_t avail_mem = 0;
|
||||
physical_memory_size_type avail_mem = 0;
|
||||
(void)os::available_memory(avail_mem);
|
||||
st->print("(%zuk free)",
|
||||
st->print("(" PHYS_MEM_TYPE_FORMAT "k free)",
|
||||
avail_mem >> 10);
|
||||
|
||||
if((sysctlbyname("vm.swapusage", &swap_usage, &size, nullptr, 0) == 0) || (errno == ENOMEM)) {
|
||||
|
||||
@@ -42,12 +42,12 @@ class os::Bsd {
|
||||
|
||||
protected:
|
||||
|
||||
static size_t _physical_memory;
|
||||
static physical_memory_size_type _physical_memory;
|
||||
static pthread_t _main_thread;
|
||||
|
||||
static bool available_memory(size_t& value);
|
||||
static bool free_memory(size_t& value);
|
||||
static size_t physical_memory() { return _physical_memory; }
|
||||
static bool available_memory(physical_memory_size_type& value);
|
||||
static bool free_memory(physical_memory_size_type& value);
|
||||
static physical_memory_size_type physical_memory() { return _physical_memory; }
|
||||
static void initialize_system_info();
|
||||
|
||||
static void rebuild_cpu_to_node_map();
|
||||
|
||||
@@ -665,15 +665,13 @@ int CgroupSubsystem::active_processor_count() {
|
||||
* -1 for unlimited
|
||||
* OSCONTAINER_ERROR for not supported
|
||||
*/
|
||||
jlong CgroupSubsystem::memory_limit_in_bytes() {
|
||||
jlong CgroupSubsystem::memory_limit_in_bytes(julong upper_bound) {
|
||||
CachingCgroupController<CgroupMemoryController>* contrl = memory_controller();
|
||||
CachedMetric* memory_limit = contrl->metrics_cache();
|
||||
if (!memory_limit->should_check_metric()) {
|
||||
return memory_limit->value();
|
||||
}
|
||||
julong phys_mem = static_cast<julong>(os::Linux::physical_memory());
|
||||
log_trace(os, container)("total physical memory: " JULONG_FORMAT, phys_mem);
|
||||
jlong mem_limit = contrl->controller()->read_memory_limit_in_bytes(phys_mem);
|
||||
jlong mem_limit = contrl->controller()->read_memory_limit_in_bytes(upper_bound);
|
||||
// Update cached metric to avoid re-reading container settings too often
|
||||
memory_limit->set_value(mem_limit, OSCONTAINER_CACHE_TIMEOUT);
|
||||
return mem_limit;
|
||||
@@ -841,21 +839,16 @@ jlong CgroupController::limit_from_str(char* limit_str) {
|
||||
|
||||
// CgroupSubsystem implementations
|
||||
|
||||
jlong CgroupSubsystem::memory_and_swap_limit_in_bytes() {
|
||||
julong phys_mem = static_cast<julong>(os::Linux::physical_memory());
|
||||
julong host_swap = os::Linux::host_swap();
|
||||
return memory_controller()->controller()->memory_and_swap_limit_in_bytes(phys_mem, host_swap);
|
||||
jlong CgroupSubsystem::memory_and_swap_limit_in_bytes(julong upper_mem_bound, julong upper_swap_bound) {
|
||||
return memory_controller()->controller()->memory_and_swap_limit_in_bytes(upper_mem_bound, upper_swap_bound);
|
||||
}
|
||||
|
||||
jlong CgroupSubsystem::memory_and_swap_usage_in_bytes() {
|
||||
julong phys_mem = static_cast<julong>(os::Linux::physical_memory());
|
||||
julong host_swap = os::Linux::host_swap();
|
||||
return memory_controller()->controller()->memory_and_swap_usage_in_bytes(phys_mem, host_swap);
|
||||
jlong CgroupSubsystem::memory_and_swap_usage_in_bytes(julong upper_mem_bound, julong upper_swap_bound) {
|
||||
return memory_controller()->controller()->memory_and_swap_usage_in_bytes(upper_mem_bound, upper_swap_bound);
|
||||
}
|
||||
|
||||
jlong CgroupSubsystem::memory_soft_limit_in_bytes() {
|
||||
julong phys_mem = static_cast<julong>(os::Linux::physical_memory());
|
||||
return memory_controller()->controller()->memory_soft_limit_in_bytes(phys_mem);
|
||||
jlong CgroupSubsystem::memory_soft_limit_in_bytes(julong upper_bound) {
|
||||
return memory_controller()->controller()->memory_soft_limit_in_bytes(upper_bound);
|
||||
}
|
||||
|
||||
jlong CgroupSubsystem::memory_throttle_limit_in_bytes() {
|
||||
@@ -894,7 +887,6 @@ jlong CgroupSubsystem::cpu_usage_in_micros() {
|
||||
return cpuacct_controller()->cpu_usage_in_micros();
|
||||
}
|
||||
|
||||
void CgroupSubsystem::print_version_specific_info(outputStream* st) {
|
||||
julong phys_mem = static_cast<julong>(os::Linux::physical_memory());
|
||||
memory_controller()->controller()->print_version_specific_info(st, phys_mem);
|
||||
void CgroupSubsystem::print_version_specific_info(outputStream* st, julong upper_mem_bound) {
|
||||
memory_controller()->controller()->print_version_specific_info(st, upper_mem_bound);
|
||||
}
|
||||
|
||||
@@ -233,14 +233,14 @@ class CgroupMemoryController: public CHeapObj<mtInternal> {
|
||||
public:
|
||||
virtual jlong read_memory_limit_in_bytes(julong upper_bound) = 0;
|
||||
virtual jlong memory_usage_in_bytes() = 0;
|
||||
virtual jlong memory_and_swap_limit_in_bytes(julong host_mem, julong host_swap) = 0;
|
||||
virtual jlong memory_and_swap_usage_in_bytes(julong host_mem, julong host_swap) = 0;
|
||||
virtual jlong memory_and_swap_limit_in_bytes(julong upper_mem_bound, julong upper_swap_bound) = 0;
|
||||
virtual jlong memory_and_swap_usage_in_bytes(julong upper_mem_bound, julong upper_swap_bound) = 0;
|
||||
virtual jlong memory_soft_limit_in_bytes(julong upper_bound) = 0;
|
||||
virtual jlong memory_throttle_limit_in_bytes() = 0;
|
||||
virtual jlong memory_max_usage_in_bytes() = 0;
|
||||
virtual jlong rss_usage_in_bytes() = 0;
|
||||
virtual jlong cache_usage_in_bytes() = 0;
|
||||
virtual void print_version_specific_info(outputStream* st, julong host_mem) = 0;
|
||||
virtual void print_version_specific_info(outputStream* st, julong upper_mem_bound) = 0;
|
||||
virtual bool needs_hierarchy_adjustment() = 0;
|
||||
virtual bool is_read_only() = 0;
|
||||
virtual const char* subsystem_path() = 0;
|
||||
@@ -251,7 +251,7 @@ class CgroupMemoryController: public CHeapObj<mtInternal> {
|
||||
|
||||
class CgroupSubsystem: public CHeapObj<mtInternal> {
|
||||
public:
|
||||
jlong memory_limit_in_bytes();
|
||||
jlong memory_limit_in_bytes(julong upper_bound);
|
||||
int active_processor_count();
|
||||
|
||||
virtual jlong pids_max() = 0;
|
||||
@@ -272,14 +272,14 @@ class CgroupSubsystem: public CHeapObj<mtInternal> {
|
||||
jlong cpu_usage_in_micros();
|
||||
|
||||
jlong memory_usage_in_bytes();
|
||||
jlong memory_and_swap_limit_in_bytes();
|
||||
jlong memory_and_swap_usage_in_bytes();
|
||||
jlong memory_soft_limit_in_bytes();
|
||||
jlong memory_and_swap_limit_in_bytes(julong upper_mem_bound, julong upper_swap_bound);
|
||||
jlong memory_and_swap_usage_in_bytes(julong upper_mem_bound, julong upper_swap_bound);
|
||||
jlong memory_soft_limit_in_bytes(julong upper_bound);
|
||||
jlong memory_throttle_limit_in_bytes();
|
||||
jlong memory_max_usage_in_bytes();
|
||||
jlong rss_usage_in_bytes();
|
||||
jlong cache_usage_in_bytes();
|
||||
void print_version_specific_info(outputStream* st);
|
||||
void print_version_specific_info(outputStream* st, julong upper_mem_bound);
|
||||
};
|
||||
|
||||
// Utility class for storing info retrieved from /proc/cgroups,
|
||||
|
||||
@@ -136,35 +136,35 @@ bool CgroupV1Controller::needs_hierarchy_adjustment() {
|
||||
}
|
||||
|
||||
static inline
|
||||
void verbose_log(julong read_mem_limit, julong host_mem) {
|
||||
void verbose_log(julong read_mem_limit, julong upper_mem_bound) {
|
||||
if (log_is_enabled(Debug, os, container)) {
|
||||
jlong mem_limit = (jlong)read_mem_limit; // account for negative values
|
||||
if (mem_limit < 0 || read_mem_limit >= host_mem) {
|
||||
if (mem_limit < 0 || read_mem_limit >= upper_mem_bound) {
|
||||
const char *reason;
|
||||
if (mem_limit == OSCONTAINER_ERROR) {
|
||||
reason = "failed";
|
||||
} else if (mem_limit == -1) {
|
||||
reason = "unlimited";
|
||||
} else {
|
||||
assert(read_mem_limit >= host_mem, "Expected read value exceeding host_mem");
|
||||
assert(read_mem_limit >= upper_mem_bound, "Expected read value exceeding upper memory bound");
|
||||
// Exceeding physical memory is treated as unlimited. This implementation
|
||||
// caps it at host_mem since Cg v1 has no value to represent 'max'.
|
||||
reason = "ignored";
|
||||
}
|
||||
log_debug(os, container)("container memory limit %s: " JLONG_FORMAT ", using host value " JLONG_FORMAT,
|
||||
reason, mem_limit, host_mem);
|
||||
log_debug(os, container)("container memory limit %s: " JLONG_FORMAT ", upper bound is " JLONG_FORMAT,
|
||||
reason, mem_limit, upper_mem_bound);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jlong CgroupV1MemoryController::read_memory_limit_in_bytes(julong phys_mem) {
|
||||
jlong CgroupV1MemoryController::read_memory_limit_in_bytes(julong upper_bound) {
|
||||
julong memlimit;
|
||||
CONTAINER_READ_NUMBER_CHECKED(reader(), "/memory.limit_in_bytes", "Memory Limit", memlimit);
|
||||
if (memlimit >= phys_mem) {
|
||||
verbose_log(memlimit, phys_mem);
|
||||
if (memlimit >= upper_bound) {
|
||||
verbose_log(memlimit, upper_bound);
|
||||
return (jlong)-1;
|
||||
} else {
|
||||
verbose_log(memlimit, phys_mem);
|
||||
verbose_log(memlimit, upper_bound);
|
||||
return (jlong)memlimit;
|
||||
}
|
||||
}
|
||||
@@ -181,10 +181,10 @@ jlong CgroupV1MemoryController::read_memory_limit_in_bytes(julong phys_mem) {
|
||||
* * -1 if there isn't any limit in place (note: includes values which exceed a physical
|
||||
* upper bound)
|
||||
*/
|
||||
jlong CgroupV1MemoryController::read_mem_swap(julong host_total_memsw) {
|
||||
jlong CgroupV1MemoryController::read_mem_swap(julong upper_memsw_bound) {
|
||||
julong memswlimit;
|
||||
CONTAINER_READ_NUMBER_CHECKED(reader(), "/memory.memsw.limit_in_bytes", "Memory and Swap Limit", memswlimit);
|
||||
if (memswlimit >= host_total_memsw) {
|
||||
if (memswlimit >= upper_memsw_bound) {
|
||||
log_trace(os, container)("Memory and Swap Limit is: Unlimited");
|
||||
return (jlong)-1;
|
||||
} else {
|
||||
@@ -192,8 +192,8 @@ jlong CgroupV1MemoryController::read_mem_swap(julong host_total_memsw) {
|
||||
}
|
||||
}
|
||||
|
||||
jlong CgroupV1MemoryController::memory_and_swap_limit_in_bytes(julong host_mem, julong host_swap) {
|
||||
jlong memory_swap = read_mem_swap(host_mem + host_swap);
|
||||
jlong CgroupV1MemoryController::memory_and_swap_limit_in_bytes(julong upper_mem_bound, julong upper_swap_bound) {
|
||||
jlong memory_swap = read_mem_swap(upper_mem_bound + upper_swap_bound);
|
||||
if (memory_swap == -1) {
|
||||
return memory_swap;
|
||||
}
|
||||
@@ -202,7 +202,7 @@ jlong CgroupV1MemoryController::memory_and_swap_limit_in_bytes(julong host_mem,
|
||||
// supported.
|
||||
jlong swappiness = read_mem_swappiness();
|
||||
if (swappiness == 0 || memory_swap == OSCONTAINER_ERROR) {
|
||||
jlong memlimit = read_memory_limit_in_bytes(host_mem);
|
||||
jlong memlimit = read_memory_limit_in_bytes(upper_mem_bound);
|
||||
if (memory_swap == OSCONTAINER_ERROR) {
|
||||
log_trace(os, container)("Memory and Swap Limit has been reset to " JLONG_FORMAT " because swap is not supported", memlimit);
|
||||
} else {
|
||||
@@ -220,9 +220,9 @@ jlong memory_swap_usage_impl(CgroupController* ctrl) {
|
||||
return (jlong)memory_swap_usage;
|
||||
}
|
||||
|
||||
jlong CgroupV1MemoryController::memory_and_swap_usage_in_bytes(julong phys_mem, julong host_swap) {
|
||||
jlong memory_sw_limit = memory_and_swap_limit_in_bytes(phys_mem, host_swap);
|
||||
jlong memory_limit = read_memory_limit_in_bytes(phys_mem);
|
||||
jlong CgroupV1MemoryController::memory_and_swap_usage_in_bytes(julong upper_mem_bound, julong upper_swap_bound) {
|
||||
jlong memory_sw_limit = memory_and_swap_limit_in_bytes(upper_mem_bound, upper_swap_bound);
|
||||
jlong memory_limit = read_memory_limit_in_bytes(upper_mem_bound);
|
||||
if (memory_sw_limit > 0 && memory_limit > 0) {
|
||||
jlong delta_swap = memory_sw_limit - memory_limit;
|
||||
if (delta_swap > 0) {
|
||||
@@ -238,10 +238,10 @@ jlong CgroupV1MemoryController::read_mem_swappiness() {
|
||||
return (jlong)swappiness;
|
||||
}
|
||||
|
||||
jlong CgroupV1MemoryController::memory_soft_limit_in_bytes(julong phys_mem) {
|
||||
jlong CgroupV1MemoryController::memory_soft_limit_in_bytes(julong upper_bound) {
|
||||
julong memsoftlimit;
|
||||
CONTAINER_READ_NUMBER_CHECKED(reader(), "/memory.soft_limit_in_bytes", "Memory Soft Limit", memsoftlimit);
|
||||
if (memsoftlimit >= phys_mem) {
|
||||
if (memsoftlimit >= upper_bound) {
|
||||
log_trace(os, container)("Memory Soft Limit is: Unlimited");
|
||||
return (jlong)-1;
|
||||
} else {
|
||||
@@ -336,10 +336,10 @@ jlong CgroupV1MemoryController::kernel_memory_usage_in_bytes() {
|
||||
return (jlong)kmem_usage;
|
||||
}
|
||||
|
||||
jlong CgroupV1MemoryController::kernel_memory_limit_in_bytes(julong phys_mem) {
|
||||
jlong CgroupV1MemoryController::kernel_memory_limit_in_bytes(julong upper_bound) {
|
||||
julong kmem_limit;
|
||||
CONTAINER_READ_NUMBER_CHECKED(reader(), "/memory.kmem.limit_in_bytes", "Kernel Memory Limit", kmem_limit);
|
||||
if (kmem_limit >= phys_mem) {
|
||||
if (kmem_limit >= upper_bound) {
|
||||
return (jlong)-1;
|
||||
}
|
||||
return (jlong)kmem_limit;
|
||||
@@ -351,9 +351,9 @@ jlong CgroupV1MemoryController::kernel_memory_max_usage_in_bytes() {
|
||||
return (jlong)kmem_max_usage;
|
||||
}
|
||||
|
||||
void CgroupV1MemoryController::print_version_specific_info(outputStream* st, julong phys_mem) {
|
||||
void CgroupV1MemoryController::print_version_specific_info(outputStream* st, julong mem_bound) {
|
||||
jlong kmem_usage = kernel_memory_usage_in_bytes();
|
||||
jlong kmem_limit = kernel_memory_limit_in_bytes(phys_mem);
|
||||
jlong kmem_limit = kernel_memory_limit_in_bytes(mem_bound);
|
||||
jlong kmem_max_usage = kernel_memory_max_usage_in_bytes();
|
||||
|
||||
OSContainer::print_container_helper(st, kmem_limit, "kernel_memory_limit_in_bytes");
|
||||
|
||||
@@ -79,17 +79,17 @@ class CgroupV1MemoryController final : public CgroupMemoryController {
|
||||
}
|
||||
jlong read_memory_limit_in_bytes(julong upper_bound) override;
|
||||
jlong memory_usage_in_bytes() override;
|
||||
jlong memory_and_swap_limit_in_bytes(julong host_mem, julong host_swap) override;
|
||||
jlong memory_and_swap_usage_in_bytes(julong host_mem, julong host_swap) override;
|
||||
jlong memory_and_swap_limit_in_bytes(julong upper_mem_bound, julong upper_swap_bound) override;
|
||||
jlong memory_and_swap_usage_in_bytes(julong upper_mem_bound, julong upper_swap_bound) override;
|
||||
jlong memory_soft_limit_in_bytes(julong upper_bound) override;
|
||||
jlong memory_throttle_limit_in_bytes() override;
|
||||
jlong memory_max_usage_in_bytes() override;
|
||||
jlong rss_usage_in_bytes() override;
|
||||
jlong cache_usage_in_bytes() override;
|
||||
jlong kernel_memory_usage_in_bytes();
|
||||
jlong kernel_memory_limit_in_bytes(julong host_mem);
|
||||
jlong kernel_memory_limit_in_bytes(julong upper_bound);
|
||||
jlong kernel_memory_max_usage_in_bytes();
|
||||
void print_version_specific_info(outputStream* st, julong host_mem) override;
|
||||
void print_version_specific_info(outputStream* st, julong upper_mem_bound) override;
|
||||
bool needs_hierarchy_adjustment() override {
|
||||
return reader()->needs_hierarchy_adjustment();
|
||||
}
|
||||
@@ -101,7 +101,7 @@ class CgroupV1MemoryController final : public CgroupMemoryController {
|
||||
const char* cgroup_path() override { return reader()->cgroup_path(); }
|
||||
private:
|
||||
jlong read_mem_swappiness();
|
||||
jlong read_mem_swap(julong host_total_memsw);
|
||||
jlong read_mem_swap(julong upper_memsw_bound);
|
||||
|
||||
public:
|
||||
CgroupV1MemoryController(const CgroupV1Controller& reader)
|
||||
|
||||
@@ -181,7 +181,7 @@ jlong CgroupV2MemoryController::memory_usage_in_bytes() {
|
||||
return (jlong)memusage;
|
||||
}
|
||||
|
||||
jlong CgroupV2MemoryController::memory_soft_limit_in_bytes(julong phys_mem) {
|
||||
jlong CgroupV2MemoryController::memory_soft_limit_in_bytes(julong upper_bound) {
|
||||
jlong mem_soft_limit;
|
||||
CONTAINER_READ_NUMBER_CHECKED_MAX(reader(), "/memory.low", "Memory Soft Limit", mem_soft_limit);
|
||||
return mem_soft_limit;
|
||||
@@ -224,19 +224,19 @@ jlong CgroupV2MemoryController::cache_usage_in_bytes() {
|
||||
// respectively. In order to properly report a cgroup v1 like
|
||||
// compound value we need to sum the two values. Setting a swap limit
|
||||
// without also setting a memory limit is not allowed.
|
||||
jlong CgroupV2MemoryController::memory_and_swap_limit_in_bytes(julong phys_mem,
|
||||
julong host_swap /* unused in cg v2 */) {
|
||||
jlong CgroupV2MemoryController::memory_and_swap_limit_in_bytes(julong upper_mem_bound,
|
||||
julong upper_swap_bound /* unused in cg v2 */) {
|
||||
jlong swap_limit;
|
||||
bool is_ok = reader()->read_number_handle_max("/memory.swap.max", &swap_limit);
|
||||
if (!is_ok) {
|
||||
// Some container tests rely on this trace logging to happen.
|
||||
log_trace(os, container)("Swap Limit failed: %d", OSCONTAINER_ERROR);
|
||||
// swap disabled at kernel level, treat it as no swap
|
||||
return read_memory_limit_in_bytes(phys_mem);
|
||||
return read_memory_limit_in_bytes(upper_mem_bound);
|
||||
}
|
||||
log_trace(os, container)("Swap Limit is: " JLONG_FORMAT, swap_limit);
|
||||
if (swap_limit >= 0) {
|
||||
jlong memory_limit = read_memory_limit_in_bytes(phys_mem);
|
||||
jlong memory_limit = read_memory_limit_in_bytes(upper_mem_bound);
|
||||
assert(memory_limit >= 0, "swap limit without memory limit?");
|
||||
return memory_limit + swap_limit;
|
||||
}
|
||||
@@ -252,7 +252,7 @@ jlong memory_swap_current_value(CgroupV2Controller* ctrl) {
|
||||
return (jlong)swap_current;
|
||||
}
|
||||
|
||||
jlong CgroupV2MemoryController::memory_and_swap_usage_in_bytes(julong host_mem, julong host_swap) {
|
||||
jlong CgroupV2MemoryController::memory_and_swap_usage_in_bytes(julong upper_mem_bound, julong upper_swap_bound) {
|
||||
jlong memory_usage = memory_usage_in_bytes();
|
||||
if (memory_usage >= 0) {
|
||||
jlong swap_current = memory_swap_current_value(reader());
|
||||
@@ -276,7 +276,7 @@ jlong memory_limit_value(CgroupV2Controller* ctrl) {
|
||||
* memory limit in bytes or
|
||||
* -1 for unlimited, OSCONTAINER_ERROR for an error
|
||||
*/
|
||||
jlong CgroupV2MemoryController::read_memory_limit_in_bytes(julong phys_mem) {
|
||||
jlong CgroupV2MemoryController::read_memory_limit_in_bytes(julong upper_bound) {
|
||||
jlong limit = memory_limit_value(reader());
|
||||
if (log_is_enabled(Trace, os, container)) {
|
||||
if (limit == -1) {
|
||||
@@ -287,18 +287,18 @@ jlong CgroupV2MemoryController::read_memory_limit_in_bytes(julong phys_mem) {
|
||||
}
|
||||
if (log_is_enabled(Debug, os, container)) {
|
||||
julong read_limit = (julong)limit; // avoid signed/unsigned compare
|
||||
if (limit < 0 || read_limit >= phys_mem) {
|
||||
if (limit < 0 || read_limit >= upper_bound) {
|
||||
const char* reason;
|
||||
if (limit == -1) {
|
||||
reason = "unlimited";
|
||||
} else if (limit == OSCONTAINER_ERROR) {
|
||||
reason = "failed";
|
||||
} else {
|
||||
assert(read_limit >= phys_mem, "Expected mem limit to exceed host memory");
|
||||
assert(read_limit >= upper_bound, "Expected mem limit to exceed upper memory bound");
|
||||
reason = "ignored";
|
||||
}
|
||||
log_debug(os, container)("container memory limit %s: " JLONG_FORMAT ", using host value " JLONG_FORMAT,
|
||||
reason, limit, phys_mem);
|
||||
log_debug(os, container)("container memory limit %s: " JLONG_FORMAT ", upper bound is " JLONG_FORMAT,
|
||||
reason, limit, upper_bound);
|
||||
}
|
||||
}
|
||||
return limit;
|
||||
@@ -327,7 +327,7 @@ bool CgroupV2Controller::needs_hierarchy_adjustment() {
|
||||
return strcmp(_cgroup_path, "/") != 0;
|
||||
}
|
||||
|
||||
void CgroupV2MemoryController::print_version_specific_info(outputStream* st, julong phys_mem) {
|
||||
void CgroupV2MemoryController::print_version_specific_info(outputStream* st, julong upper_mem_bound) {
|
||||
jlong swap_current = memory_swap_current_value(reader());
|
||||
jlong swap_limit = memory_swap_limit_value(reader());
|
||||
|
||||
|
||||
@@ -115,15 +115,15 @@ class CgroupV2MemoryController final: public CgroupMemoryController {
|
||||
}
|
||||
|
||||
jlong read_memory_limit_in_bytes(julong upper_bound) override;
|
||||
jlong memory_and_swap_limit_in_bytes(julong host_mem, julong host_swp) override;
|
||||
jlong memory_and_swap_usage_in_bytes(julong host_mem, julong host_swp) override;
|
||||
jlong memory_and_swap_limit_in_bytes(julong upper_mem_bound, julong upper_swap_bound) override;
|
||||
jlong memory_and_swap_usage_in_bytes(julong upper_mem_bound, julong upper_swap_bound) override;
|
||||
jlong memory_soft_limit_in_bytes(julong upper_bound) override;
|
||||
jlong memory_throttle_limit_in_bytes() override;
|
||||
jlong memory_usage_in_bytes() override;
|
||||
jlong memory_max_usage_in_bytes() override;
|
||||
jlong rss_usage_in_bytes() override;
|
||||
jlong cache_usage_in_bytes() override;
|
||||
void print_version_specific_info(outputStream* st, julong host_mem) override;
|
||||
void print_version_specific_info(outputStream* st, julong upper_mem_bound) override;
|
||||
bool is_read_only() override {
|
||||
return reader()->is_read_only();
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@ void OSContainer::init() {
|
||||
// We can be in one of two cases:
|
||||
// 1.) On a physical Linux system without any limit
|
||||
// 2.) On a physical Linux system with a limit enforced by other means (like systemd slice)
|
||||
any_mem_cpu_limit_present = cgroup_subsystem->memory_limit_in_bytes() > 0 ||
|
||||
os::Linux::active_processor_count() != cgroup_subsystem->active_processor_count();
|
||||
any_mem_cpu_limit_present = memory_limit_in_bytes() > 0 ||
|
||||
os::Linux::active_processor_count() != active_processor_count();
|
||||
if (any_mem_cpu_limit_present) {
|
||||
reason = " because either a cpu or a memory limit is present";
|
||||
} else {
|
||||
@@ -103,24 +103,47 @@ const char * OSContainer::container_type() {
|
||||
return cgroup_subsystem->container_type();
|
||||
}
|
||||
|
||||
bool OSContainer::available_memory_in_container(julong& value) {
|
||||
jlong mem_limit = memory_limit_in_bytes();
|
||||
jlong mem_usage = memory_usage_in_bytes();
|
||||
|
||||
if (mem_limit > 0 && mem_usage <= 0) {
|
||||
log_debug(os, container)("container memory usage failed: " JLONG_FORMAT, mem_usage);
|
||||
}
|
||||
|
||||
if (mem_limit <= 0 || mem_usage <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
value = mem_limit > mem_usage ? static_cast<julong>(mem_limit - mem_usage) : 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
jlong OSContainer::memory_limit_in_bytes() {
|
||||
assert(cgroup_subsystem != nullptr, "cgroup subsystem not available");
|
||||
return cgroup_subsystem->memory_limit_in_bytes();
|
||||
julong phys_mem = static_cast<julong>(os::Linux::physical_memory());
|
||||
return cgroup_subsystem->memory_limit_in_bytes(phys_mem);
|
||||
}
|
||||
|
||||
jlong OSContainer::memory_and_swap_limit_in_bytes() {
|
||||
assert(cgroup_subsystem != nullptr, "cgroup subsystem not available");
|
||||
return cgroup_subsystem->memory_and_swap_limit_in_bytes();
|
||||
julong phys_mem = static_cast<julong>(os::Linux::physical_memory());
|
||||
julong host_swap = os::Linux::host_swap();
|
||||
return cgroup_subsystem->memory_and_swap_limit_in_bytes(phys_mem, host_swap);
|
||||
}
|
||||
|
||||
jlong OSContainer::memory_and_swap_usage_in_bytes() {
|
||||
assert(cgroup_subsystem != nullptr, "cgroup subsystem not available");
|
||||
return cgroup_subsystem->memory_and_swap_usage_in_bytes();
|
||||
julong phys_mem = static_cast<julong>(os::Linux::physical_memory());
|
||||
julong host_swap = os::Linux::host_swap();
|
||||
return cgroup_subsystem->memory_and_swap_usage_in_bytes(phys_mem, host_swap);
|
||||
}
|
||||
|
||||
jlong OSContainer::memory_soft_limit_in_bytes() {
|
||||
assert(cgroup_subsystem != nullptr, "cgroup subsystem not available");
|
||||
return cgroup_subsystem->memory_soft_limit_in_bytes();
|
||||
julong phys_mem = static_cast<julong>(os::Linux::physical_memory());
|
||||
return cgroup_subsystem->memory_soft_limit_in_bytes(phys_mem);
|
||||
}
|
||||
|
||||
jlong OSContainer::memory_throttle_limit_in_bytes() {
|
||||
@@ -150,7 +173,8 @@ jlong OSContainer::cache_usage_in_bytes() {
|
||||
|
||||
void OSContainer::print_version_specific_info(outputStream* st) {
|
||||
assert(cgroup_subsystem != nullptr, "cgroup subsystem not available");
|
||||
cgroup_subsystem->print_version_specific_info(st);
|
||||
julong phys_mem = static_cast<julong>(os::Linux::physical_memory());
|
||||
cgroup_subsystem->print_version_specific_info(st, phys_mem);
|
||||
}
|
||||
|
||||
char * OSContainer::cpu_cpuset_cpus() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user